# -*- coding: UTF-8 -*-
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 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, 1691)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1691)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(beginDate = "", secID = "", ticker = "", endDate = "", listStatusCD = "", field = "", pandas = "1"):
    """
    输入证券ID或证券交易代码，获取证券停牌起始时间、截止时间。也可以根据日期范围查询出在这段时间内持续停牌的证券，例如起始日期、结束日期设置为同一天，可以查询出当天停牌的所有证券。
    
    :param beginDate: 查询范围的起始日期，输入格式“YYYYMMDD”。,beginDate、secID、ticker、endDate至少选择一个
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,beginDate、secID、ticker、endDate至少选择一个
    :param ticker: 证券交易代码，如'000001',可以是列表,beginDate、secID、ticker、endDate至少选择一个
    :param endDate: 查询范围的截止日期，输入格式，输入格式“YYYYMMDD”。若无输入值，默认获取从开始日期到现在所有存在过的停牌记录。,beginDate、secID、ticker、endDate至少选择一个
    :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/getSecHalt.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)
    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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 150)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 150)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", assetClass = "", ticker = "", cnSpell = "", field = "", pandas = "1"):
    """
    输入一个或多个证券交易代码，获取证券ID，证券在数据结构中的一个唯一识别的编码；同时可以获取输入证券的基本上市信息，如交易市场，上市状态，交易币种，ISIN编码等。
    
    :param partyID: 机构ID，assetClass为股票和债券时，是发行人的机构ID；assetClass为基金时，是基金管理人的机构ID；assetClass为指数时，是指数发布机构ID。,可以是列表,partyID、assetClass、ticker、cnSpell至少选择一个
    :param assetClass: 证券类型，可供选择类型：E 股票,B 债券,F 基金,IDX 指数,FU 期货,OP 期权；默认为 E。,partyID、assetClass、ticker、cnSpell至少选择一个
    :param ticker: 证券在交易所的交易代码，可输入一个或多个，用","分隔，如"000001"、"000001,600001"。,可以是列表,partyID、assetClass、ticker、cnSpell至少选择一个
    :param cnSpell: 通过输入证券简称拼音的方式，获取证券交易代码等信息，拼音以使用汉字拼音首位连接，如“平安银行”，即“PAYH”。,可以是列表,partyID、assetClass、ticker、cnSpell至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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)
    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("&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)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1281)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1281)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 1878)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1878)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", 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 field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1293)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1293)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 = "", field = "", pandas = "1"):
    """
    输入行业分类通联编码(如，010303表示申万行业分类2014版)或输入一个行业分类标准名称，获取行业分类标准下行业划分
    
    :param industryVersion: 行业分类标准。SW- 申万行业分类,industryVersion、industryVersionCD至少选择一个
    :param industryVersionCD: 行业分类标准数字编码。010301-证监会行业V2012、010303-申万行业、010308-中证行业,可以是列表,industryVersion、industryVersionCD至少选择一个
    :param industryLevel: 输入数字如1,2,3,4，可指定查询的第几级行业,可以是列表,可空
    :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/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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1473)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1473)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SecTypeRelGet(typeID = "", secID = "", ticker = "", field = "", pandas = "1"):
    """
    记录证券每个分类的成分，证券分类可通过在getSecType获取。
    
    :param typeID: 输入某个证券分类的typeID值（分类的子节点），可获取该子节点分类下全部成分。分类可在api如DataAPI.SecTypeXXXGet获取，如地域类DataAPI.SecTypeRegionGet。,可空
    :param secID: 输入证券ID，可查询该证券属于哪些分类的成分，支持输入多个证券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/master/getSecTypeRel.csv?ispandas=1&') 
    if not isinstance(typeID, str) and not isinstance(typeID, unicode):
        typeID = str(typeID)

    requestString.append("typeID=%s"%(typeID))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_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, 1457)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1457)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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: 可以输入证券交易代码，如'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/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, 1365)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1365)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(typeID = "", secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深股票地域分类，以注册地所在行政区域为标准。详细划分可在商品“地域分类”获取
    
    :param typeID: 输入某个证券分类的typeID值（分类的子节点），可获取该子节点分类下全部成分。分类可在api如DataAPI.SecTypeXXXGet获取，如地域类DataAPI.SecTypeRegionGet。,可空
    :param secID: 输入证券ID，可查询该证券属于哪些分类的成分，支持输入多个证券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/master/getSecTypeRegionRel.csv?ispandas=1&') 
    if not isinstance(typeID, str) and not isinstance(typeID, unicode):
        typeID = str(typeID)

    requestString.append("typeID=%s"%(typeID))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_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, 1429)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1429)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(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/master/getSecType.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, 1458)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1458)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(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/master/getSecTypeRegion.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, 1430)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1430)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1537)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1537)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 2010)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2010)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 MktEqudGet(tradeDate = "", secID = "", ticker = "", beginDate = "", endDate = "", isOpen = "", field = "", pandas = "1"):
    """
    获取沪深AB股日行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段，每日16:00更新
    
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部沪深股票日行情数据，输入格式“YYYYMMDD”,tradeDate、secID、ticker至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,tradeDate、secID、ticker至少选择一个
    :param ticker: 股票交易代码，如'000001'（可多值输入）,可以是列表,tradeDate、secID、ticker至少选择一个
    :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&') 
    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))
    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, 80)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 80)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(tradeDate = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取四大期货交易所日行情信息，包括开高低收、成交量、成交金额、持仓量、结算价、主力合约标记等信息， 其中主力合约按持仓量计算，每日16:00更新。
    
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部期货合约日行情数据，输入格式“YYYYMMDD”,tradeDate、secID、ticker至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,tradeDate、secID、ticker至少选择一个
    :param ticker: 合约交易代码，如'cu1106'（可多值输入）,可以是列表,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/getMktFutd.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, 85)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 85)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(tradeDate = "", indexID = "", ticker = "", beginDate = "", endDate = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取指数日线行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。
    
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部指数日行情数据，输入格式“YYYYMMDD”,tradeDate、indexID、ticker至少选择一个
    :param indexID: 通联编制的指数编码。 可通过指数代码和证券类型（assetClass=IDX）在DataAPI.SecIDGet获取到。,可以是列表,tradeDate、indexID、ticker至少选择一个
    :param ticker: 指数交易代码（可多值输入）,可以是列表,tradeDate、indexID、ticker至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :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/getMktIdxd.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    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:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.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, 90)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 90)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(tradeDate = "", secID = "", ticker = "", beginDate = "", endDate = "", assetClass = "", field = "", pandas = "1"):
    """
    获取沪深交易所交易日大宗交易成交价，成交量等信息。
    
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部沪深证券大宗交易数据，输入格式“YYYYMMDD”,tradeDate、secID、ticker至少选择一个
    :param secID: 证券ID，证券统一编码，可通过交易代码在DataAPI.SecIDGet获取到。（可多值输入）,可以是列表,tradeDate、secID、ticker至少选择一个
    :param ticker: 证券交易代码，如'000001'（可多值输入）,可以是列表,tradeDate、secID、ticker至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :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/getMktBlockd.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))
    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, 82)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 82)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(tradeDate = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取债券回购交易开、收、高、低，成交等日行情信息，每日16:00前更新
    
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部证券债券回购日行情数据，输入格式“YYYYMMDD”,tradeDate、secID、ticker至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如202001.XSHG。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,tradeDate、secID、ticker至少选择一个
    :param ticker: 回购交易代码，如'204001'（可多值输入）,可以是列表,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/getMktRepod.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, 84)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 84)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(tradeDate = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取债券交易开、收、高、低，成交等日行情信息，每日16:00前更新
    
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部债券日行情数据，输入格式“YYYYMMDD”,tradeDate、secID、ticker至少选择一个
    :param secID: 证券ID，证券统一编码，可通过交易代码在DataAPI.SecIDGet获取到。（可多值输入）,可以是列表,tradeDate、secID、ticker至少选择一个
    :param ticker: 债券交易代码，如'100501'（可多值输入）,可以是列表,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/getMktBondd.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, 83)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 83)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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"):
    """
    获取香港交易所股票开、收、高、低，成交等日行情信息，每日17:00前更新
    
    :param secID: 证券ID，证券统一编码，可通过交易代码在DataAPI.SecIDGet获取到。（可多值输入）,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 交易代码，如'00001'（可多值输入）,可以是列表,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/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, 81)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 81)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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 MktTickRTSnapshotGet(ticker = "", securityID = "", exchangeCD = "", assetClass = "", field = "", pandas = "1"):
    """
    高频数据，获取一只或多只证券最新Level1股票信息。 输入一只或多只证券代码，如000001.XSHG (上证指数） 或000001.XSHE（平安银行）， 还有所选字段， 得到证券的最新交易快照。 证券可以是股票，指数， 部分债券或 基金。
    
    :param ticker: 证券在证券市场通用的交易代码，可选参数，允许多值逗号分隔,可以是列表,ticker、securityID至少选择一个
    :param securityID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 证券市场代码请根据证券的上市市场确定：XSHG-上海证券交易所，XSHE-深圳证券交易所，XHKG-香港交易所。,可以是列表,ticker、securityID至少选择一个
    :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/getTickRTSnapshot.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("&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("&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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 91)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 91)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'amplitude', u'askBook_volume4', u'turnoverRate', u'askBook_price5', u'negMarketValue', u'askBook_volume5', u'staticPE', 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'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, 92)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 92)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 97)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 97)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)

    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [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'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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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 = "", 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 pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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))
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 94)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 94)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 95)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 95)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 96)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 96)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 98)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 98)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)

    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'bidVolume2', u'bidPrice3', 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'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'bidPrice1', u'bidVolume1', u'askVolume5', u'bidPrice2']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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(endOffset, securityID, date, startOffset, field = "", pandas = "1"):
    """
    高频数据，获取一只或多只证券在历史上某一个交易日内某个时间段的Tick数据。 输入一只证券代码，如000001.XSHE（平安银行）。证券包括股票， 指数，部分债券和基金,按照时间排序。
    
    :param endOffset: 结束时间偏移，相对于早上八点的秒数偏移，如6000，注意endOffset-startOffset最多为600(10分钟)，此外，注意最后返回的数据的时间区间是[startOffset, endOffset)
    :param securityID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 证券市场代码请根据证券的上市市场确定：XSHG-上海证券交易所，XSHE-深圳证券交易所，XHKG-香港交易所。,可以是列表
    :param date: 历史交易日期。格式是YYYYMMDD，如20140106表示2014年1月6日。
    :param startOffset: 开始时间偏移，相对于早上八点的秒数偏移，如5400
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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&') 
    if not isinstance(endOffset, str) and not isinstance(endOffset, unicode):
        endOffset = str(endOffset)

    requestString.append("endOffset=%s"%(endOffset))
    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))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 99)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 99)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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，此时表示查主力合约。
    :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, 100)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 100)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'milliSecOffset', u'contractType', 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'mflag', u'source', 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'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 = {'dataTime': 'str','instrumentID': 'str','contractType': 'str','exchangeCD': 'str','clearingDay': '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, 101)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 101)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 102)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 102)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'milliSecOffset', u'contractType', 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'mflag', u'source', 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'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 = {'dataTime': 'str','instrumentID': '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，若空，则表示没有上界,可空
    :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, 103)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 103)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 104)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 104)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 105)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 105)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(tradeDate = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取基金买卖交易开、收、高、低，成交等日行情信息。
    
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部基金日行情数据，输入格式“YYYYMMDD”,tradeDate、secID、ticker至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,tradeDate、secID、ticker至少选择一个
    :param ticker: 基金交易代码，如'150001',可以是列表,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/getMktFundd.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, 89)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 89)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    获取期货会员在各交易日期货合约的成交量、成交排名及成交量增减信息，每日18:00前更新。
    
    :param beginDate: 根据交易日期范围查询的起始日期，默认为一年前。输入格式“YYYYMMDD”,可空
    :param endDate: 根据交易日期范围查询的截止日期，默认为当前日期。输入格式“YYYYMMDD”,可空
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.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/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, 88)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 88)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    获取期货会员在各交易日期货合约的空头持仓、排名及空头持仓增减信息，每日18:00前更新。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 期货合约代码，如'SR501',可以是列表,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/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, 87)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 87)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    获取期货会员在各交易日期货合约的多头持仓、排名及多头持仓增减信息，每日18:00前更新。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 期货合约代码，如'cu1501',可以是列表,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/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, 86)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 86)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    获取期货仓单日报情况，包括品种代码、交易市场、仓库、上期仓单量、本期仓单量等字段，每日16:00更新
    
    :param beginDate: 起始日期，默认为一周前，输入格式“YYYYMMDD”
    :param endDate: 截止日期，默认为当前日期，输入格式“YYYYMMDD”
    :param contractObject: 品种代码,可以是列表,可空
    :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/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, 1592)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1592)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(tradeDate = "", mainCon = "", contractMark = "", contractObject = "", startDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取四大期货交易所日行情信息，包括开高低收、成交量、成交金额、持仓量、结算价、主力合约标记等信息， 其中主力合约按持仓量计算，每日16:00更新。
    
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部期货合约日行情数据，输入格式“YYYYMMDD”,tradeDate、mainCon、contractMark、contractObject至少选择一个
    :param mainCon: 1为主力合约，0为非主力合约,tradeDate、mainCon、contractMark、contractObject至少选择一个
    :param contractMark: 商品期货：L0-即将进入交割的合约L1-连一合约（连续合约）L2-连二合约L3-连三合约L4-连四合约金融期货（四个合约）：L0-当月连续L1-下月连续L3-当季连续L6-下季连续金融期货（三个合约）：L3-当季连续L6-下季连续L9-隔季连续,tradeDate、mainCon、contractMark、contractObject至少选择一个
    :param contractObject: 期货合约标的。例如，CU-阴极铜，AU-黄金。对应DataAPI.SysCodeGet.codeTypeID=60003。,tradeDate、mainCon、contractMark、contractObject至少选择一个
    :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&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    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:
        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, 1282)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1282)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(tradeDate = "", secID = "", optID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    主要记录上交所期权行情，包含昨结算、昨收盘、开盘价、最高价、最低价、收盘价、结算价、成交量、成交金额、持仓量等字段，每日16:00前更新。
    
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部期权日行情数据，输入格式“YYYYMMDD”,tradeDate、secID、optID、ticker至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,tradeDate、secID、optID、ticker至少选择一个
    :param optID: 交易所指定8位代码,tradeDate、secID、optID、ticker至少选择一个
    :param ticker: 合约交易代码,tradeDate、secID、optID、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/getMktOptd.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    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:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1292)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1292)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 MktEqudAdjGet(tradeDate = "", secID = "", ticker = "", isOpen = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深A股和B股前复权日行情信息，包含前复权昨收价、前复权开盘价、前复权最高价、前复权最低价、前复权收盘价。
    
    :param tradeDate: 交易日。输入格式“YYYYMMDD”,tradeDate、secID、ticker至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,tradeDate、secID、ticker至少选择一个
    :param ticker: 输入股票代码，如000001。,可以是列表,tradeDate、secID、ticker至少选择一个
    :param isOpen: 股票今日是否开盘标记位：0-今日未开盘，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/getMktEqudAdj.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)
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1290)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1290)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(exDivDate = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深A股和B股用来调整行情的前复权因子数据，包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及因子调整的截止日期。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。
    
    :param exDivDate: 除权除息日，输入格式：YYYYMMDD,exDivDate、secID、ticker至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,exDivDate、secID、ticker至少选择一个
    :param ticker: 一只或多只股票代码，用,分隔，如000001,000002。,可以是列表,exDivDate、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/getMktAdjf.csv?ispandas=1&') 
    try:
        exDivDate = exDivDate.strftime('%Y%m%d')
    except:
        exDivDate = exDivDate.replace('-', '')
    requestString.append("exDivDate=%s"%(exDivDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 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, 1291)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1291)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 MktOptionTickRTSnapshotGet(optionId = "", field = "", pandas = "1"):
    """
    高频数据，获取期权最新市场信息快照
    
    :param optionId: 期权代码，如果为空，返回当前所有期权,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)

    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'preClosePrice', u'dealAmount', u'timestamp', u'dataDate', u'dataTime', u'optionId', u'instrumentID', u'preSettlePrice', u'settlePrice', u'openPrice', u'volume', u'value', 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'auctionPrice', u'auctionQty', u'totalLongPosition', 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 = {'dataDate': 'str','dataTime': 'str','optionId': 'str','instrumentID': '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 = "", field = "", pandas = "1"):
    """
    高频数据，获取一只期权在历史上某一交易日内的Tick数据
    
    :param optionId: 期权代码
    :param date: 数据日期。格式是YYYYMMDD，如20130729，2013年7月29日。
    :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/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))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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','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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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 = {'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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'currencyCD', u'barTime', u'dataDate', u'clearingDay', 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','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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)

    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'openInterest', u'unit', u'instrumentID', u'exchangeCD', u'currencyCD', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue', u'dataDate', u'clearingDay']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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 MktFutdVolGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取四大期货交易所日行情信息，包括开高低收、成交量、成交金额、持仓量、结算价、主力合约标记等信息， 其中主力合约按成交量计算，每日17:00更新。
    
    :param secID: 合约内部编码，可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 合约内部编码，可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,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, 1321)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1321)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 MktEqudLatelyGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深股票个股最近一次日行情，当日数据更新返回当日数据，当日数据为更新之前返回上一个交易日数据，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段，每日16:30更新。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用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, 1327)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1327)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 MktLimitGet(exchangeCD = "", secID = "", ticker = "", tradeDate = "", field = "", pandas = "1"):
    """
    主要记录盘前每日个股及基金涨跌停板价格，每日9:00更新
    
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所；XIBE-中国银行间市场等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,exchangeCD、secID、ticker、tradeDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,exchangeCD、secID、ticker、tradeDate至少选择一个
    :param ticker: 证券交易代码,可以是列表,exchangeCD、secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日，输入格式YYYYMMDD,exchangeCD、secID、ticker、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/getMktLimit.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("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1357)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1357)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 1367)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1367)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1369)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1369)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 SWIndustryRTRankGet(desc = "", field = "", pandas = "1"):
    """
    获取申万行业涨跌幅排行
    
    :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/getSWIndustryRTRank.csv?ispandas=1&') 
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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', u'bidAskRatio', u'upNum', u'flatNum', u'downNum', u'totalAskVolume', u'totalBidVolume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)

    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [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'type', u'dataDate', u'dataTime', 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 = {'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 MktQuoteInfoGet(secID = "", ticker = "", exchangeCD = "", field = "", pandas = "1"):
    """
    记录沪深交易所行情报价要素，包含最小申报数量、申报价格最小变动单位
    
    :param secID: 证券ID，通联给证券赋予的编码，可通过交易代码等在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param exchangeCD: 交易市场。例如，XSHG-上海证券交易所；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/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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 MktFunddAdjGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    主要记录基金每日后复权行情，包括开高低收、成交量、成交价格等
    
    :param secID: 证券内部编码,可以是列表,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/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, 1489)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1489)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'barTime', u'dataDate', u'closePrice', u'openPrice', 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','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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)

    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'totalLongPosition', u'unit', u'optionId', u'exchangeCD', u'currencyCD', 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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    获取沪深A股和B股调整行情的后复权因子数据（以2006-01-01价格为基准），包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及因子调整的截止日期。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param ticker: 一只或多只股票代码，用,分隔，如000001,000002。,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所；XIBE-中国银行间市场等。对应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/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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    获取获取沪深A股和B股后复权日行情信息（以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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 MktFunddAdjBfGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    基金前复权行情，包含前收盘、今开盘、最高价、最低价、收盘价等
    
    :param secID: 证券内部编码,可以是列表,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, 1588)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1588)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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: 交易日，输入格式“YYYYMMDD”,tradeDate、secID、ticker至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,tradeDate、secID、ticker至少选择一个
    :param ticker: 股票交易代码，如'000001'（可多值输入）,可以是列表,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, 1585)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1585)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_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(industryID = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取每日行业资金流向数据，包含行业资金流入、资金流出和资金净流入等，行业分类标准为证监会行业分类标准
    
    :param industryID: 证监会行业分类标准的二级行业ID。 可以使用getIndustry接口获取所有ID，industryVersionCD=010301，industryLevel=2。,可以是列表,industryID、tradeDate至少选择一个
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部行业日资金流向数据，输入格式“YYYYMMDD”,industryID、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/getMktIndustryFlow.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)
    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, 1586)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1586)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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"):
    """
    获取沪深A股和B股调整行情的后复权因子数据（以上市价格为基准），包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及因子调整的截止日期。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param ticker: 一只或多只股票代码，用,分隔，如000001,000002。,可以是列表,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所；XIBE-中国银行间市场等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param exDivDate: 除权除息日，输入格式：YYYYMMDD,secID、ticker、exchangeCD、exDivDate至少选择一个
    :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/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, 1597)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1597)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", isOpen = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取获取沪深A股和B股后复权日行情信息（以上市价格为基准），包含后复权昨收价、后复权开盘价、后复权最高价、后复权最低价、后复权收盘价，每日16:00更新。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 输入股票代码，如000001。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日。输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param isOpen: 股票今日是否开盘标记位：0-今日未开盘，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/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))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1598)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1598)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    获取股票日资金流向按照单类大小明细，包含小单资金流入，小单资金流出，小单资金净流入等，以L2数据计算得出其中单类大小定义为：（单位：元）N：0S:(0,100万]M:(100万,500万]L:(500万,1000万]XL:1000万以上
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.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/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, 1643)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1643)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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"):
    """
    获取行业日资金流向按照单类大小明细，包含小单资金流入，小单资金流出，小单资金净流入等，以L2数据计算得出其中单类大小定义为：（单位：元）N：0S:(0,100万]M:(100万,500万]L:(500万,1000万]XL:1000万以上
    
    :param tradeDate: 交易日期,可空
    :param beginDate: 起始日期，输入格式为yyyymmdd,可空
    :param endDate: 截止日期，输入格式为yyyymmdd,可空
    :param industryID: 证监会行业分类标准的二级行业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/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, 1644)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1644)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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"):
    """
    记录周期内，如一周内新增投资者数量、期末投资者数量、期末持仓投资者数量、期间参与交易的投资者数量的统计数据。
    
    :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, 1653)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1653)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 MktSpotdGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取现货日行情，包含上海黄金交易所所有现货行情。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'SPOT',输入'Au(T+D)'，可获取到ID'AU(T+D).SGEX'后，在此输入'AU(T+D).SGEX',可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在交易所的交易代码,可以是列表,secID、ticker至少选择一个
    :param tradeDate: 交易日期，格式为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/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, 1654)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1654)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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 = {'sec_ID': '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 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, 1738)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1738)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 1655)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1655)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1659)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1659)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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"):
    """
    获取期权交易统计
    
    :param tradeDate: 交易日期，格式为yyyymmdd,tradeDate、secID、ticker至少选择一个
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'F 基金',输入'510050'，可获取到ID'510050.XSHG'后，在此输入510050.XSHG',可以是列表,tradeDate、secID、ticker至少选择一个
    :param ticker: 证券交易代码,可以是列表,tradeDate、secID、ticker至少选择一个
    :param beginDate: 起始日期，格式为yyyymmdd,可空
    :param endDate: 截止日期，格式为yyyymmdd,可空
    :param statsInterval: 数据统计区间。2=月；4=日。对应DataAPI.SysCodeGet.codeTypeID=50042。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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, 1661)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1661)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取最活跃3个合约品种及持仓最大3个合约交易排名情况，次日上午9:00更新
    
    :param ticker: 输入证券交易代码，如“510050”,ticker、secID至少选择一个
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'F 基金',输入'510050'，可获取到ID'510050.XSHG'后，在此输入510050.XSHG',可以是列表,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/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:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1662)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1662)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", isOpen = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取股票周行情，包含周开高低收量价、涨跌幅、换手率等
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、weekEndDate至少选择一个
    :param ticker: 股票交易代码，如'000001'（可多值输入）,可以是列表,secID、ticker、weekEndDate至少选择一个
    :param weekEndDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、weekEndDate至少选择一个
    :param isOpen: 股票当周是否开盘标记位：0-未开盘，1-开盘。 当周交易天数为0时属于未开盘。,可空
    :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/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))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1674)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1674)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", isOpen = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取股票周前复权行情，包含开高低收量价、涨跌幅、换手率等，数据正常调用时间为21:00 - 次日 18:00
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、weekEndDate至少选择一个
    :param ticker: 股票交易代码，如'000001'（可多值输入）,可以是列表,secID、ticker、weekEndDate至少选择一个
    :param weekEndDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、weekEndDate至少选择一个
    :param isOpen: 股票当周是否开盘标记位：0-未开盘，1-开盘。 当周交易天数为0时属于未开盘。,可空
    :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/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))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1675)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1675)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", isOpen = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取股票周后复权行情，包含开高低收量价、涨跌幅、换手率等，数据正常调用时间为21:00 - 次日 18:00
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、weekEndDate至少选择一个
    :param ticker: 股票交易代码，如'000001'（可多值输入）,可以是列表,secID、ticker、weekEndDate至少选择一个
    :param weekEndDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、weekEndDate至少选择一个
    :param isOpen: 股票当周是否开盘标记位：0-未开盘，1-开盘。 当周交易天数为0时属于未开盘。,可空
    :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/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))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1676)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1676)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", isOpen = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取股票月行情，包含月开高低收量价、涨跌幅、换手率等
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、monthEndDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、monthEndDate至少选择一个
    :param monthEndDate: 月最后交易日，输入格式“YYYYMMDD”,secID、ticker、monthEndDate至少选择一个
    :param isOpen: 股票当月是否开盘标记位：0-未开盘，1-开盘。 当月交易天数为0时属于未开盘。,可空
    :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/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))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1678)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1678)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", isOpen = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取股票月前复权行情，包含开高低收量价、涨跌幅、换手率等，数据正常调用时间为21:00 - 次日 18:00
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、monthEndDate至少选择一个
    :param ticker: 股票交易代码，如'000001'（可多值输入）,可以是列表,secID、ticker、monthEndDate至少选择一个
    :param monthEndDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、monthEndDate至少选择一个
    :param isOpen: 股票当月是否开盘标记位：0-未开盘，1-开盘。 当月交易天数为0时属于未开盘。,可空
    :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/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))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1679)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1679)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", isOpen = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取股票月后复权行情，包含开高低收量价、涨跌幅、换手率等，数据正常调用时间为21:00 - 次日 18:00
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、monthEndDate至少选择一个
    :param ticker: 股票交易代码，如'000001'（可多值输入）,可以是列表,secID、ticker、monthEndDate至少选择一个
    :param monthEndDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、monthEndDate至少选择一个
    :param isOpen: 股票当月是否开盘标记位：0-未开盘，1-开盘。 当月交易天数为0时属于未开盘。,可空
    :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/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))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1680)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1680)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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。
    
    :param secID: 拆借品种ID，可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 拆借品种，如隔夜，Hibor1D,可以是列表,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, 1664)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1664)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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'},  )
        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: 证券交易代码，如'111593425'（可多值输入）,可以是列表,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/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, 1681)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1681)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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: 公开市场操作交易方式:1-正回购、2-逆回购、3-SLO投放、4-SLO回笼、5-MLF中期借贷便利。对应DataAPI.SysCodeGet.codeTypeID=12002。,可以是列表
    :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/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, 1682)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1682)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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: 货币代码。对应DataAPI.SysCodeGet.codeTypeID=10004。
    :param beginTime: 查询发布开始时间，格式为YYYYMMDDHHMMSS，如20160222093000,可空
    :param endTime: 查询发布截止时间，格式为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, 1689)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1689)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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"):
    """
    获取存款类机构间同业拆借行情，包含开、高、低、收、加权利率等，次日上午8:00更新
    
    :param secID: 证券内部编码，可通过交易代码在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 证券交易代码，如'IBO1M'（可多值输入）,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部Chibor行情数据，输入格式“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/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, 1692)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1692)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(tradeDate = "", secID = "", ticker = "", abnormalTypeCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深交易所每日股票交易公开信息，包括涨跌幅异常、换手率异常等各种公开信息
    
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部数据，输入格式“YYYYMMDD”,tradeDate、secID、ticker、abnormalTypeCD至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,tradeDate、secID、ticker、abnormalTypeCD至少选择一个
    :param ticker: 证券交易代码，如'600000'（可多值输入）,可以是列表,tradeDate、secID、ticker、abnormalTypeCD至少选择一个
    :param abnormalTypeCD: 异动类型代码，可在DataAPI.SysCodeGet中获得，令codeTypeID=12006,可以是列表,tradeDate、secID、ticker、abnormalTypeCD至少选择一个
    :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&') 
    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("&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:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1785)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1785)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、side、rank、tradeDate至少选择一个
    :param ticker: 证券交易代码，如'600000'（可多值输入）,可以是列表,secID、ticker、side、rank、tradeDate至少选择一个
    :param side: 买卖方向，B-买入、S-卖出、N-买卖综合,可以是列表,secID、ticker、side、rank、tradeDate至少选择一个
    :param rank: 排名，提供第1~5名的排名,可以是列表,secID、ticker、side、rank、tradeDate至少选择一个
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部数据，输入格式“YYYYMMDD”,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, 1786)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1786)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    获取货币市场参考利率指标，包含上海证券交易所债券质押式回购定盘利率和中国外汇交易中心回购定盘利率、七天回购移动平均利率。
    
    :param secID: 利率指标，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'IR',输入'FRGC001'，可获取到ID'FRGC001.XSHG'后，在此输入'FRGC001.XSHG',可以是列表,secID、ticker至少选择一个
    :param ticker: 指标代码,如FRGC001,可以是列表,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, 2104)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2104)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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: 统计角度编码，可在DataAPI.SysCodeGet获得，令codeTypeID=12004,选择其中2~4位编码,可以是列表,可空
    :param statsTypeClassCD: 角度类型细分编码，可在DataAPI.SysCodeGet获得，令codeTypeID=12004,选择其中4~6位编码,可以是列表,可空
    :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, 2105)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2105)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2106)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2106)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取纳斯达克证券交易所、纽约证券交易所的股票日行情
    
    :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/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:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1831)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1831)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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"):
    """
    获取沪深A股和B股调整行情的后复权因子数据（以上市价格为基准），包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及因子调整的截止日期，每日早9:00更新，包含当日除权除息股票的复权因子信息。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。
    
    :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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 1839)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1839)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 MktRANKInstTrGet(tradeDate, industryName = "", field = "", pandas = "1"):
    """
    获取每个交易日行业换手率排名信息，按照申万一级行业进行分类，只展示行业排名前三名的证券，每日下午16:30更新
    
    :param tradeDate: 交易日期，格式为yyyymmdd
    :param industryName: 行业名称，如：传媒,电气设备等，可多值输入，以下为申万28个行业名称：休闲服务,房地产,商业贸易,综合,钢铁,农林牧渔,食品饮料,采掘,电子,国防军工,通信,公用事业,交通运输,轻工制造,计算机,电气设备,家用电器,医药生物,传媒,非银金融,汽车,有色金属,机械设备,建筑材料,化工,纺织服装,银行,建筑装饰,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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("&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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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/market/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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'utcOffset', u'currencyCD', u'prevClosePrice', u'openPrice', u'volume', u'value', u'tradeNumber', u'highPrice', u'lowPrice', u'lastPrice', u'askBook', u'bidBook', u'suspension', u'closePrice', u'totalBidVolume', u'weightedAvgBidPrice', u'totalAskVolume', u'weightedAvgAskPrice', u'IOPV']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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','utcOffset': '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 MktIdxwGet(beginDate, endDate, indexID = "", ticker = "", field = "", pandas = "1"):
    """
    获取指数周线行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。每日16:00到20:00,次日上午10:00到12:00循环生产。
    
    :param beginDate: 起始日期，输入格式“YYYYMMDD”
    :param endDate: 截止日期，输入格式“YYYYMMDD”
    :param indexID: 指数内部编码，可通过交易代码在DataAPI.MktIdxdGet获取。,可以是列表,可空
    :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/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, 1855)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1855)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'wAvgReyurn', 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:00到20:00,次日上午10:00到12:00循环生产。
    
    :param beginDate: 起始日期，输入格式“YYYYMMDD”
    :param endDate: 截止日期，输入格式“YYYYMMDD”
    :param indexID: 指数内部编码，可通过交易代码在DataAPI.MktIdxdGet获取。,可以是列表,可空
    :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/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, 1856)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1856)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 1859)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1859)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 1860)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1860)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 MktVolAdjfGet(secID = "", ticker = "", beginDate = "", endDate = "", exchangeCD = "", exDivDate = "", field = "", pandas = "1"):
    """
    沪深股票成交量复权因子，包含单次和累计成交量前后复权因子，每日早上8:30更新
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param ticker: 股票交易代码，如'000001',可以是列表,secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param beginDate: 除权除息日查询为基准，查询开始日期,输入格式"YYYYMMDD",secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param endDate: 除权除息日查询为基准，查询截止日期,输入格式"YYYYMMDD",secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所；XIBE-中国银行间市场等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,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, 1864)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1864)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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"):
    """
    期货周行情，每个合约仅计算当日有交易的交易日数据，每日下午17: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/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, 1872)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1872)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    期货月行情，每个合约仅计算当日有交易的交易日数据，每日下午17: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/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, 1873)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1873)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    获取沪深A股和B股调整行情的后复权因子数据（以上市价格为基准），包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及因子调整的截止日期。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整，数据于每日早上9:00更新。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、exDivDate至少选择一个
    :param ticker: 一只或多只股票代码，用,分隔，如000001,000002。,可以是列表,secID、ticker、exDivDate至少选择一个
    :param exDivDate: 除权除息日,可以是列表,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, 1877)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1877)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 Group引领国际期货市场发展，包含芝加哥商业交易所 (CME)、 芝加哥期货交易所(CBOT)、纽约商业交易所 (NYMEX)、纽约商品交易所 (COMEX)，数据每日10:00am更新
    
    :param ticker: 合约在CME交易的交易代码,可以是列表,ticker、tradeDate、beginDate、endDate、contractObject至少选择一个
    :param tradeDate: 交易日期，格式为yyyymmdd,可以是列表,ticker、tradeDate、beginDate、endDate、contractObject至少选择一个
    :param beginDate: 起始日期，格式为yyyymmdd,ticker、tradeDate、beginDate、endDate、contractObject至少选择一个
    :param endDate: 结束日期，格式为yyyymmdd,ticker、tradeDate、beginDate、endDate、contractObject至少选择一个
    :param contractObject: CME全品种标的： HG0--铜现货（TAS） GCT--黄金期货（TAS） GCK--黄金期货 HGS--铜金融期货 ZNC--锌期货 SIT--银期货（TAS） MJP--铝日本普氏期货 SI--银期货 SIL--1000盎司白银期货 AUP--铝MW美国交易溢价普氏期货 LED--铅期货 AEP--欧洲豪华铝金属通报期货 A38--铝合金（A-380标准普尔全球普氏）期货 ALI--物理铝期货 HG--铜期货 HGT--铜期货（TAS） QO--迷你黄金期货 QI--迷你白银期货 EDP--欧洲完税铝溢价期货合约 MGC--E-微型黄金期货 QC--E-微型铜期货 GC--黄金期货 其中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, 1879)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1879)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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"):
    """
    获取期货合约每个交易日的涨停价和跌停价信息，目前只包括正在进行交易合约的信息，每日16: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, 1889)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1889)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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年以后上市的股票连板天数信息，包括是否持续连板以及连板收益率等，每日16:00更新
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.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/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, 1890)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1890)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 1896)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1896)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1897)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1897)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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"):
    """
    获取每日创业板估值信息，即每日动态市盈率处于不同标准的股票个数信息，每日18:30更新
    
    :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, 1956)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1956)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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"):
    """
    获取每日个期货品种多空持仓占比情况，包含一个品种持买量、持卖量及持卖量占持买量的比例，每日18:30更新
    
    :param contractObject: 期货合约标的。例如，CU-阴极铜，AU-黄金。对应DataAPI.SysCodeGet.codeTypeID=60003。,可以是列表
    :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/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, 1957)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1957)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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"):
    """
    获取估值期货升贴水信息，包含期货价格、对应股指价格及每个股指期货合约的升贴水情况，每日18:30更新
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.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/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, 1958)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1958)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", field = "", pandas = "1"):
    """
    获取指数估值信息，包含市值、PE、PB等信息，目前仅包含上证综指、沪深300、中小板综、中小板指、创业板指、创业板R、创业板综，每日18:30更新
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.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/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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1959)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1959)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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 = "", field = "", pandas = "1"):
    """
    获取申万三级行业估计信息，包含市值、PE、PB等信息，每日18:30更新
    
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”
    :param industryID: 通联编制的行业分类编码，可以通过getIndustry获取。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1960)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1960)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, field = "", pandas = "1"):
    """
    获取每日股息率排名前100的股票信息，包含当日的收盘价、近一年分红汇总及股息率，每日18:30更新
    
    :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/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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1961)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1961)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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"):
    """
    获取可转债折溢价信息，包含每日可转债价格、正股价格、可转债折溢价等信息，每日18:30更新
    
    :param SecID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用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, 1962)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1962)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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"):
    """
    获取每日新三板股票日行情信息，包含股票的开、高、低、收、量等信息，每日17:00更新
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.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/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, 1963)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1963)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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"):
    """
    获取每日新三板盘前静态信息，包含每股面值、涨停价、跌停价等信息，每日9:20更新
    
    :param SecID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.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/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, 1964)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1964)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'dataDate', u'dataTime', u'timeOffset', u'statusCode', u'preclosePrice', u'openPrice', u'lastPrice', u'volume', u'value', u'highPrice', u'lowPrice', 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'localTime', u'seqNo']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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','dataDate': 'str','dataTime': 'str','timeOffset': '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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'dataDate', u'dataTime', u'timeOffset', u'statusCode', u'preclosePrice', u'openPrice', u'lastPrice', u'volume', u'value', u'highPrice', u'lowPrice', u'localTime', u'seqNo']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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','timeOffset': '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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'orderTime', u'dataTime', u'transactionUnit', u'transactionType', u'volume', u'price', u'recordStatus', u'localTime', u'seqNo']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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','orderTime': 'str','dataTime': 'str','transactionUnit': 'str','transactionType': 'str','recordStatus': 'str','localTime': '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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'dataTime', u'shortNm', u'preclosePrice', u'openPrice', u'volume', u'value', u'deal', u'highPrice', u'lowPrice', u'lastPrice', u'bigPrice1', u'bigVolume1', u'bigPrice2', u'bigVolume2', u'bigPrice3', u'bigVolume3', u'bigPrice4', u'bigVolume4', u'bigPrice5', u'bigVolume5', 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 = {'ticker': '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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'timestamp', u'change', u'changePct', u'dataTime', u'highPrice', u'lastPrice', u'localTimestamp', u'lowPrice', u'openPrice', u'prevClosePrice', u'shortNM', u'utcOffset', u'value', u'volume', 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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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','timestamp': 'str','dataTime': 'str','localTimestamp': 'str','shortNM': 'str','utcOffset': '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 MktSubnewEqudGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取每日次新股日行情信息，包含次新股的当日开高低收价等，每日18:00更新
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.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/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, 1982)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1982)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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'marketValue', 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股比例等信息，每日18:00更新
    
    :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/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, 1983)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1983)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 MktAdjfAfKunhongGet(secID = "", ticker = "", exchangeCD = "", exDivDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深A股和B股调整行情的后复权因子数据（以上市价格为基准），包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及因子调整的截止日期。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param ticker: 一只或多只股票代码，用,分隔，如000001,000002。,可以是列表,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所；XIBE-中国银行间市场等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param exDivDate: 除权除息日，输入格式：YYYYMMDD,secID、ticker、exchangeCD、exDivDate至少选择一个
    :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/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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 2003)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2003)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2008)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2008)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2009)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2009)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'unit', u'ticker', 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 = {'exchangeCD': 'str','ticker': '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 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&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'utcOffset', u'currencyCD', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue', u'exchangeCD', 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','shortNM': 'str','utcOffset': 'str','currencyCD': 'str','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 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, 2064)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2064)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2069)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2069)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 MktIdxPerformanceGet(SecID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取一只指数在段时间的业绩表现数据，包含不同期间内的平均收益率，收益率方差和夏普比率信息
    
    :param SecID: 通联编制的指数编码。 可通过指数代码和证券类型（assetClass=IDX）在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, 2070)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2070)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 MktNeeqEquwGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    新三板股票周行情数据，包含周开高低收价、成交量、成交金额等
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如400002.NOBB。 可传入证券交易代码使用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, 2078)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2078)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如400002.NOBB。 可传入证券交易代码使用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, 2079)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2079)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 MktAdjfAfKunhongV2Get(secID = "", ticker = "", exchangeCD = "", exDivDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深A股和B股调整行情的后复权因子数据（以上市价格为基准），包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及因子调整的截止日期。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,可空
    :param ticker: 一只或多只股票代码，用,分隔，如000001,000002。,可以是列表,可空
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所；XIBE-中国银行间市场等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,可空
    :param exDivDate: 除权除息日，输入格式：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/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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'exchangeCD', u'unit', u'utcOffset', u'currencyCD', 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','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 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, 2134)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2134)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 2126)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2126)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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&') 
    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))
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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 SHSZBarRTIntraDayGet(unit, assetClass = "", startTime = "", endTime = "", ticker = "", exchangeCD = "", 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 assetClass: 证券类型。例如，E-股票,B-债券,F-基金。对应DataAPI.SysCodeGet.codeTypeID=10001。,可空
    :param startTime: 分钟线起始时间， 如09:40，就是从早上九点四十开始。 默认开始时间早上开市时间，即09:30，不选即为默认值,可空
    :param endTime: 分钟线终止时间， 如14:00, 就是到下午14点结束。 如终止时间是空， 则截止到最新数据或到关市为止，即15:00，不选即为默认值,可空
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :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/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(assetClass, str) and not isinstance(assetClass, unicode):
        assetClass = str(assetClass)

    requestString.append("&assetClass=%s"%(assetClass))
    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))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2150)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2150)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 HKBarRTIntraDayGet(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: 证券在证券市场通用的交易代码。,可以是列表,可空
    :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/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))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 2152)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2152)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2153)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2153)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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','tflag': '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, 2154)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2154)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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', u'currencyCD', u'dataDate', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue', 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','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 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, 2155)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2155)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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', u'currencyCD', u'dataDate', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue', 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','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 NHIndexTickHistOneDayGet(ticker, tradeDate, field = "", pandas = "1"):
    """
    高频数据，获取一只南华指数在历史上某个交易日的Tick数据，指数范围仅包含以下6个：南华工业品指数、南华能化指数、南华贵金属指数、南华商品指数、南华金属指数、南华农产品指数
    
    :param ticker: NHCI-南华工业品指数、NHCI-南华能化指数、NHCI-南华贵金属指数、NHCI-南华商品指数、NHCI-南华金属指数、NHCI-南华农产品指数,可以是列表
    :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/getNHIndexTickHistOneDay.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))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2166)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2166)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'tradeTime', u'updateSequence', u'clearingDay', u'volume', u'value', u'lastPrice', u'highPrice', u'lowPrice', u'openPrice', u'preClosePrice', 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 = {'ticker': 'str','tradeTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EnergyFutureTicksIntraDayGet(instrumentID, field = "", pandas = "1"):
    """
    高频数据，获取一只上期能源期货合约在当日内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/market/getEnergyFutureTicksIntraDay.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, 2167)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2167)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'instrumentID', 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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NHFutureIndexTickRTSnapshotGet(ticker = "", field = "", pandas = "1"):
    """
    高频数据，获取南华指数最新市场信息快照，包含以下六个指数：南华工业品指数、南华能化指数、南华贵金属指数、南华商品指数、南华金属指数、南华农产品指数
    
    :param ticker: NHCI-南华工业品指数、NHCI-南华能化指数、NHCI-南华贵金属指数、NHCI-南华商品指数、NHCI-南华金属指数、NHCI-南华农产品指数,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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/getNHFutureIndexTickRTSnapshot.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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2174)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2174)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'ticker', u'prevClosePrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'value', u'volume', 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 = {'clearingDay': 'str','dataDate': '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 SHSZTickRTSnapshotGet(exchangeCD, assetClass = "", ticker = "", field = "", pandas = "1"):
    """
    高频数据，获取一只或多只证券最新Level1信息快照。 输入一只或多只证券交易代码，如000001,并指定其证券品种,如"E",即可获取平安银行的最新市场信息快照, 证券可以是股票，指数， 部分债券或 基金
    
    :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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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 HKTickRTSnapshotGet(ticker = "", field = "", pandas = "1"):
    """
    高频数据，获取一只或多只港交所证券最新市场信息快照。 输入一只或多只证券交易代码，如000001,并指定其证券品种,如"E"(目前仅支持股票),即可获取长和的最新市场信息快照
    
    :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/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)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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','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 MktIndustryQuoteGet(tradeDate = "", beginDate = "", endDate = "", industryID = "", statsFreq = "", field = "", pandas = "1"):
    """
    获取申万三级行业板块区间行情信息,区间维度包含1日，5日，10日，30日，60日，90日，180日，360日，720日，1080日,区间行情的计算方式主要包含算数平均,总市值加权,流通市值加权等
    
    :param tradeDate: 格式为"yyyymmdd",tradeDate、beginDate、endDate至少选择一个
    :param beginDate: 格式为"yyyymmdd",tradeDate、beginDate、endDate至少选择一个
    :param endDate: 格式为"yyyymmdd",tradeDate、beginDate、endDate至少选择一个
    :param industryID: 行业划分数字编码，通联赋予,可从接口getIndustry查询,不填写默认所有行业,可以是列表,可空
    :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, 2176)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2176)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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"):
    """
    商品期权合约空头持仓排名,大商所、郑商所所期权品种信息仅公布活跃月份（大商所标的期货合约双边持仓量大于、等于2万手）合约系列
    
    :param tradeDate: 格式为"yyyymmdd",tradeDate、beginDate、endDate至少选择一个
    :param beginDate: 格式为"yyyymmdd",tradeDate、beginDate、endDate至少选择一个
    :param endDate: 格式为"yyyymmdd",tradeDate、beginDate、endDate至少选择一个
    :param secID: 通联编制的证券编码。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,可空
    :param ticker: 标的合约在交易所的交易代码,如m1801,可以是列表,可空
    :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)
    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, 2177)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2177)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    商品期权合约多头持仓排名,大商所、郑商所所期权品种信息仅公布活跃月份（大商所标的期货合约双边持仓量大于、等于2万手）合约系列
    
    :param tradeDate: 格式为"yyyymmdd",tradeDate、beginDate、endDate至少选择一个
    :param beginDate: 格式为"yyyymmdd",tradeDate、beginDate、endDate至少选择一个
    :param endDate: 格式为"yyyymmdd",tradeDate、beginDate、endDate至少选择一个
    :param secID: 通联编制的证券编码。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,可空
    :param ticker: 标的合约在交易所的交易代码,如m1801,可以是列表,可空
    :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)
    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, 2178)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2178)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    商品期权合约成交量排名,大商所、郑商所所期权品种信息仅公布活跃月份（大商所标的期货合约双边持仓量大于、等于2万手）合约系列
    
    :param tradeDate: 格式为"yyyymmdd",tradeDate、beginDate、endDate至少选择一个
    :param beginDate: 格式为"yyyymmdd",tradeDate、beginDate、endDate至少选择一个
    :param endDate: 格式为"yyyymmdd",tradeDate、beginDate、endDate至少选择一个
    :param secID: 通联编制的证券编码。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,可空
    :param ticker: 标的合约在交易所的交易代码,如m1801,可以是列表,可空
    :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)
    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, 2179)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2179)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 NHIndexTickRTIntraDayGet(ticker, field = "", pandas = "1"):
    """
    高频数据,获取一只南华期货指数在当日内的Tick数据,包含以下六个指数：南华工业品指数、南华能化指数、南华贵金属指数、南华商品指数、南华金属指数、南华农产品指数
    
    :param ticker: NHCI-南华工业品指数、NHCI-南华能化指数、NHCI-南华贵金属指数、NHCI-南华商品指数、NHCI-南华金属指数、NHCI-南华农产品指数
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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/getNHIndexTickRTIntraDay.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, 2180)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2180)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'ticker', u'prevClosePrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'value', u'volume', u'openInterest', u'dataSeq']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIdxqGet(beginDate, endDate, secID = "", field = "", pandas = "1"):
    """
    获取指数季线行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。每日16:00到20:00,次日上午10:00到12:00循环生产。
    
    :param beginDate: 起始日期，输入格式“YYYYMMDD”
    :param endDate: 截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码，可传入证券交易代码使用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/getMktIdxq.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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2185)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2185)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(beginDate, endDate, secID = "", field = "", pandas = "1"):
    """
    获取指数半年线行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。每日16:00到20:00,次日上午10:00到12:00循环生产。
    
    :param beginDate: 起始日期，输入格式“YYYYMMDD”
    :param endDate: 截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码，可传入证券交易代码使用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/getMktIdxs.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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2186)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2186)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(beginDate, endDate, secID = "", field = "", pandas = "1"):
    """
    获取指数年线行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。每日16:00到20:00,次日上午10:00到12:00循环生产。
    
    :param beginDate: 起始日期，输入格式“YYYYMMDD”
    :param endDate: 截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码，可传入证券交易代码使用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/getMktIdxa.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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2187)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2187)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 FXTickRTSnapshotGet(currencyPair, field = "", pandas = "1"):
    """
    获取福汇外汇市场信息快照
    
    :param currencyPair: 货币对，包含以下几种：USD|CHF，EUR|USD，GBP|USD，GBP|AUD，USD|CAD，NZD|USD，EUR|JPY，NZD|CAD，AUD|NZD，EUR|GBP，GBP|CAD，GBP|JPY，AUD|JPY，USD|JPY，EUR|CHF，USD|CNH，EUR|AUD，AUD|CHF，AUD|USD，USD|HKD，不输入返回全部,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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/getFXTickRTSnapshot.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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2190)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2190)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'offerID', u'quoteID', u'tradeDate', u'dataTime', u'bid', u'ask', u'Low', u'High', u'volume', u'valueDate', u'buyInterest', u'sellInterest', u'contractCurrency', u'contractMultiplier', u'Digits', u'pointSize', u'tradingStatus', 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 = {'currencyPair': 'str','quoteID': 'str','tradeDate': 'str','dataTime': 'str','valueDate': 'str','contractCurrency': 'str','tradingStatus': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FXTickRTIntraDayGet(currencyPair, field = "", pandas = "1"):
    """
    获取福汇外汇市场当日Tick数据信息
    
    :param currencyPair: 货币对，包含EUR|USD、USD|JPY、GBP|USD、USD|CHF、EUR|CHF、AUD|USD、AUD|CHF、USD|CAD、NZD|USD、EUR|GBP、USD|CNH、EUR|JPY、GBP|JPY、EUR|AUD、AUD|JPY、USD|HKD、GBP|CAD、GBP|AUD、NZD|CAD、AUD|NZD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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/getFXTickRTIntraDay.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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2203)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2203)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'updateTime', u'offerID', u'currencyPair', u'quoteID', u'bid', u'ask', u'low', u'high', u'volume', u'sellInterest', u'buyInterest', u'contractCurrency', u'digits', u'pointSize', u'contractMultiplier', u'tradingStatus', u'valueDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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','quoteID': 'str','contractCurrency': 'str','tradingStatus': 'str','valueDate': '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: 查询的起始日期，输入格式“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/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, 2214)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2214)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    获取股票季前复权行情，包含季开高低收量价、涨跌幅等信息
    
    :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/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, 2215)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2215)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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: 查询的起始日期，输入格式“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/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, 2216)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2216)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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: 查询的起始日期，输入格式“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/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, 2217)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2217)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    获取股票半年前复权行情，包含季开高低收量价、涨跌幅等信息
    
    :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/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, 2218)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2218)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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: 查询的起始日期，输入格式“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/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, 2219)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2219)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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: 查询的起始日期，输入格式“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/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, 2220)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2220)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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"):
    """
    获取股票年前复权行情，包含季开高低收量价、涨跌幅等信息
    
    :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/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, 2221)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2221)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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: 查询的起始日期，输入格式“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/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, 2222)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2222)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 FXBarRTIntraDayGet(currencyPair, field = "", pandas = "1"):
    """
    高频数据，获取福汇外汇交易市场当日分钟线数据
    
    :param currencyPair: 货币对，包含EUR|USD、USD|JPY、GBP|USD、USD|CHF、EUR|CHF、AUD|USD、AUD|CHF、USD|CAD、NZD|USD、EUR|GBP、USD|CNH、EUR|JPY、GBP|JPY、EUR|AUD、AUD|JPY、USD|HKD、GBP|CAD、GBP|AUD、NZD|CAD、AUD|NZD,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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/getFXBarRTIntraDay.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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2233)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2233)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'currencyPair', u'barTime', u'openBid', u'highBid', u'lowBid', u'closeBid', u'openAsk', u'highAsk', u'lowAsk', u'closeAsk', u'totalTicks']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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 NHIndexBarRTIntraDayGet(ticker, field = "", pandas = "1"):
    """
    高频数据，获取一只南华指数当日分钟线数据，指数范围仅包含以下6个：南华工业品指数、南华能化指数、南华贵金属指数、南华商品指数、南华金属指数、南华农产品指数
    
    :param ticker: NHCI-南华工业品指数、NHCI-南华能化指数、NHCI-南华贵金属指数、NHCI-南华商品指数、NHCI-南华金属指数、NHCI-南华农产品指数
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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/getNHIndexBarRTIntraDay.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, 2238)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2238)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'clearingDay', u'barTime', u'offSet', u'ticker', u'openPrice', u'highPrice', u'lowPrice', u'closePirce', u'volume', u'value', 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 = {'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 MktFutqGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取期货季行情，包含季开高低收量价以及持仓等信息，计算周期内剔除未成交交易日
    
    :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/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, 2223)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2223)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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: 查询的起始日期，输入格式“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/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, 2224)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2224)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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: 查询的起始日期，输入格式“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/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, 2225)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2225)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 CryptoTickRTSnapShotHBGet(instrumentID = "", field = "", pandas = "1"):
    """
    获取火币网数字货币最新市场信息快照，仅包含BTC（比特币）和LTC（莱特币）
    
    :param instrumentID: 货币代码，目前仅包含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/market/getCryptoTickRTSnapShotHB.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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2260)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2260)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'tradeDate', u'tradeTime', u'utcOffset', u'currencyCD', u'exchangeCD', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'askBook', u'bidBook', u'volume', u'totalVolume', 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 = {'instrumentID': 'str','tradeDate': 'str','tradeTime': 'str','utcOffset': 'str','currencyCD': 'str','exchangeCD': '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 FXBarHistOneDayGet(currencyPair, tradeDate, field = "", pandas = "1"):
    """
    获取外汇交易市场历史某一日的分钟线数据
    
    :param currencyPair: 货币对，包含EUR|USD、USD|JPY、GBP|USD、USD|CHF、EUR|CHF、AUD|USD、AUD|CHF、USD|CAD、NZD|USD、EUR|GBP、USD|CNH、EUR|JPY、GBP|JPY、EUR|AUD、AUD|JPY、USD|HKD、GBP|CAD、GBP|AUD、NZD|CAD、AUD|NZD
    :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/getFXBarHistOneDay.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))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2257)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2257)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'tradeDate', u'barTime', u'openBid', u'highBid', u'lowBid', u'closeBid', u'openAsk', u'highAsk', u'lowAsk', u'closeAsk', u'totalTick']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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 FXTickHistOneDayGet(currencyPair, tradeDate, field = "", pandas = "1"):
    """
    获取外汇交易市场历史某一日的Tick数据
    
    :param currencyPair: 货币对，包含EUR|USD、USD|JPY、GBP|USD、USD|CHF、EUR|CHF、AUD|USD、AUD|CHF、USD|CAD、NZD|USD、EUR|GBP、USD|CNH、EUR|JPY、GBP|JPY、EUR|AUD、AUD|JPY、USD|HKD、GBP|CAD、GBP|AUD、NZD|CAD、AUD|NZD
    :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/getFXTickHistOneDay.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))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2258)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2258)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)

    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'offerID', u'currencyPair', u'quoteID', u'bid', u'ask', u'Low', u'High', u'volume', u'updateDate', u'updateTime', u'sellInterest', u'buyInterest', u'contractCurrency', u'Digits', u'pointSize', u'contractMultiplier', u'tradingStatus', u'valueDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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','quoteID': 'str','contractCurrency': 'str','tradingStatus': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NHIndexBarHistOneDayGet(ticker, tradeDate, unit = "", field = "", pandas = "1"):
    """
    获取一只南华指数在历史某一日分钟线数据
    
    :param ticker: NHCI-南华工业品指数、NHCI-南华能化指数、NHCI-南华贵金属指数、NHCI-南华商品指数、NHCI-南华金属指数、NHCI-南华农产品指数
    :param tradeDate: 交易日期
    :param unit: 当前bar时间,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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/getNHIndexBarHistOneDay.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))
    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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2259)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2259)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'secOffSet', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'volume', u'value', 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 = {'tradeDate': '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 MktHKCbbcdGet(tradeDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取港交所牛熊证日行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段
    
    :param tradeDate: 交易日期，格式为yyyyymmdd
    :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, 2243)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2243)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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: 交易日期，格式为yyyyymmdd
    :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, 2244)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2244)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 MktEquLatestTraddayGet(tradeDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取某只股票在某一交易日的最近交易日，若当日不停牌，最近交易日即当日，若停牌，为上一个有成交的交易日
    
    :param tradeDate: 交易日期，格式为yyyyymmdd
    :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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2240)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2240)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 FdmtBSGet(ticker = "", secID = "", reportType = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, 151)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 151)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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, 152)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 152)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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, 153)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 153)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, 154)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 154)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, 155)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 155)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, 156)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 156)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 FdmtCFBankGet(ticker = "", secID = "", reportType = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, 157)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 157)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, 158)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 158)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, 159)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 159)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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, 160)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 160)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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, 161)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 161)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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, 162)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 162)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', 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 = {'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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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))
    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, 163)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 163)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', 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 = {'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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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))
    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, 164)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 164)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'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'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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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))
    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, 165)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 165)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', 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 = {'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, 166)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 166)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 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, 167)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 167)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 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, 1328)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1328)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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'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 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, 1553)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1553)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, 1554)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1554)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, 1555)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1555)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1556)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1556)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, 1557)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1557)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1558)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1558)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1559)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1559)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, 1560)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1560)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, 1561)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1561)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1562)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1562)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, 1563)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1563)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, 1564)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1564)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, 1565)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1565)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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 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, 1566)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1566)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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, 1567)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1567)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, 1568)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1568)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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'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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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'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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 1843)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1843)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'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'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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'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'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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'effectOP', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'effectTP', u'TProfit', u'incomeTax', u'effectNP', u'NIncome', 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'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'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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 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, 1844)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1844)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(endYear = "", reportType = "", secID = "", ticker = "", beginDate = "", endDate = "", beginYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    上市公司披露根据间接法编制经营活动现金流的现金流量表补充资料（仅有合并报表数据）
    
    :param endYear: 会计年度，结束时间，输入格式“YYYY”,endYear、reportType、secID、ticker、beginDate、endDate、beginYear至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,endYear、reportType、secID、ticker、beginDate、endDate、beginYear至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'00011.XHKG',可以是列表,endYear、reportType、secID、ticker、beginDate、endDate、beginYear至少选择一个
    :param ticker: 股票代码,可以是列表,endYear、reportType、secID、ticker、beginDate、endDate、beginYear至少选择一个
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMM”,endYear、reportType、secID、ticker、beginDate、endDate、beginYear至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMM”,endYear、reportType、secID、ticker、beginDate、endDate、beginYear至少选择一个
    :param beginYear: 会计年度，起始时间，输入格式“YYYY”,endYear、reportType、secID、ticker、beginDate、endDate、beginYear至少选择一个
    :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&') 
    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("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 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))
    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, 1845)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1845)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 1846)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1846)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1847)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1847)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1848)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1848)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1849)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1849)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1850)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1850)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1851)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1851)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1852)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1852)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1853)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1853)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1854)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1854)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1874)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1874)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1875)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1875)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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(beginYear = "", endYear = "", reportType = "", ticker = "", secID = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标：1、计算依据为该公司该期间最新一次披露的财务数据; 2、计算起始期间为'2007-03-31';3、单位：人民币元;4、部分科目仅对一般工商业公司进行计算
    
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",beginYear、endYear、reportType、ticker、secID、endDate、beginDate至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",beginYear、endYear、reportType、ticker、secID、endDate、beginDate至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,beginYear、endYear、reportType、ticker、secID、endDate、beginDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,beginYear、endYear、reportType、ticker、secID、endDate、beginDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,beginYear、endYear、reportType、ticker、secID、endDate、beginDate至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,beginYear、endYear、reportType、ticker、secID、endDate、beginDate至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,beginYear、endYear、reportType、ticker、secID、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/fundamental/getFdmtIndiCash.csv?ispandas=1&') 
    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("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1876)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1876)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 RRPEquFdmtRptPreGet(beginDate = "", endDate = "", secID = "", ticker = "", year = "", reportType = "", field = "", pandas = "1"):
    """
    定期公告预披露(RRP展示专用）
    
    :param beginDate: 最新预约披露日开始时间,可空
    :param endDate: 最新预约披露日结束时间,可空
    :param secID: 证券ID,可以是列表,可空
    :param ticker: 交易代码,可以是列表,可空
    :param year: 报告年份,可以是列表,可空
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，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/getRRPEquFdmtRptPre.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("&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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", 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 field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'EndDate', u'DateType', u'InfoSource', u'IfMerged', u'IfAdjusted', u'Classification', u'SN', u'Project', u'Industry', u'IfSum', u'MainOperIncome', u'MainOperCost', u'MainOperProfit', u'GrossProfit', 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 = {'InfoSource': 'str','Project': '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, 1913)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1913)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1914)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1914)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1915)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1915)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1916)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1916)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1917)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1917)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1918)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1918)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1919)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1919)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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, 1920)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1920)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', 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, 1921)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1921)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'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'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, 1922)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1922)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', 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, 1923)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1923)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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, 1924)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1924)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 1925)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1925)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'endDate', 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'endDate', 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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 NeeqFdmtCFBankGet(ticker = "", secID = "", reportType = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', 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 = {'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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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))
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', 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 = {'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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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))
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'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'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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", 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 endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为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/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:
        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))
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', 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 = {'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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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 = "", year = "", endDate = "", beginDate = "", 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 year: 年度，会计期间所在年度,可以是列表,可空
    :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/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)
    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)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'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'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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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 HKFdmtBSGet(secID = "", ticker = "", itemCD = "", listStatusCD = "", isPre = "", publishDateBegin = "", publishDateEnd = "", beginDate = "", endDate = "", mergedFlag = "", itemTypeCD = "", field = "", pandas = "1"):
    """
    获取港股上市公司资产负债表相关数据。1、对企业会计年度没有统一规定，公司可以根据自己的情况确定会计年度，按公司需要，也可变更年度结算日，故披露日期也较分散；2、对企业记账本位币没有特别要求，港交所上市企业来自全球，不同国家公司记账本位币很有可能不同，收录的为没有经过汇率处理的原始报表披露数据；3、对采用会计准则没有特别要求，企业可以根据实际情况确定会计准则，准则之间的差异有可能会导致同一名称科目结果有所差异，使用不同准则的公司横向可比性降低；4、若某家公司退市或转版，曾经使用过的交易代码可能会被分配给另一家公司，同一个ticker会有对应多家公司的可能性。
    
    :param secID: 证券展示代码,可以是列表,secID、ticker、itemCD至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker、itemCD至少选择一个
    :param itemCD: 科目代码。DataAPI.SysCodeGet.codeTypeID=70019&useType=VALUE_NUM_CD。,可以是列表,secID、ticker、itemCD至少选择一个
    :param listStatusCD: 上市状态,可空
    :param isPre: 是否历史证券代码；1-是（曾经使用该交易代码，现已退市或转版），0-否（现使用该交易代码）,可空
    :param publishDateBegin: 发布日期的起始日期，输入格式"YYYYMMDD",可空
    :param publishDateEnd: 发布日期的结束日期，输入格式"YYYYMMDD",可空
    :param beginDate: 报告会计期末的起始日期，输入格式"YYYYMMDD",可空
    :param endDate: 报告会计期末的结束日期，输入格式"YYYYMMDD",可空
    :param mergedFlag: 合并标志；1-合并，2-母公司,可空
    :param itemTypeCD: 科目种类代码。对应DataAPI.SysCodeGet.codeTypeID=70019&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/fundamental/getHKFdmtBS.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    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(listStatusCD, str) and not isinstance(listStatusCD, unicode):
        listStatusCD = str(listStatusCD)

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

    requestString.append("&isPre=%s"%(isPre))
    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))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        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(mergedFlag, str) and not isinstance(mergedFlag, unicode):
        mergedFlag = str(mergedFlag)

    requestString.append("&mergedFlag=%s"%(mergedFlag))
    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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2066)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2066)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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'listStatusCD', u'listDate', u'delistDate', u'isPre', u'partyID', u'publishDate', u'endDateRep', u'fiscalPeriod', u'fiscalChgCD', u'mergedFlag', u'accoutingStandards', u'industryCategory', u'currencyCd', u'itemTypeCD', u'itemType', u'itemNO', u'itemCD', u'itemName', u'valEnd', u'valBeg']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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','mergedFlag': 'str','accoutingStandards': 'str','industryCategory': 'str','currencyCd': 'str','itemTypeCD': 'str','itemType': '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 HKFdmtISGet(secID = "", ticker = "", itemCD = "", listStatusCD = "", isPre = "", publishDateBegin = "", publishDateEnd = "", beginDate = "", endDate = "", mergedFlag = "", field = "", pandas = "1"):
    """
    获取港股上市公司利润表相关数据。1、对企业会计年度没有统一规定，公司可以根据自己的情况确定会计年度，按公司需要，也可变更年度结算日，故披露日期也较分散；2、对企业记账本位币没有特别要求，港交所上市企业来自全球，不同国家公司记账本位币很有可能不同，收录的为没有经过汇率处理的原始报表披露数据；3、对采用会计准则没有特别要求，企业可以根据实际情况确定会计准则，准则之间的差异有可能会导致同一名称科目结果有所差异，使用不同准则的公司横向可比性降低；4、若某家公司退市或转版，曾经使用过的交易代码可能会被分配给另一家公司，同一个ticker会有对应多家公司的可能性。
    
    :param secID: 证券展示代码,可以是列表,secID、ticker、itemCD至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker、itemCD至少选择一个
    :param itemCD: 科目代码。DataAPI.SysCodeGet.codeTypeID=70020&useType=VALUE_NUM_CD。,可以是列表,secID、ticker、itemCD至少选择一个
    :param listStatusCD: 上市状态,可空
    :param isPre: 是否历史证券代码；1-是（曾经使用该交易代码，现已退市或转版），0-否（现使用该交易代码）,可空
    :param publishDateBegin: 发布日期的起始日期，输入格式"YYYYMMDD",可空
    :param publishDateEnd: 发布日期的结束日期，输入格式"YYYYMMDD",可空
    :param beginDate: 报告会计期末的起始日期，输入格式"YYYYMMDD",可空
    :param endDate: 报告会计期末的结束日期，输入格式"YYYYMMDD",可空
    :param mergedFlag: 合并标志；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/fundamental/getHKFdmtIS.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    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(listStatusCD, str) and not isinstance(listStatusCD, unicode):
        listStatusCD = str(listStatusCD)

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

    requestString.append("&isPre=%s"%(isPre))
    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))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        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(mergedFlag, str) and not isinstance(mergedFlag, unicode):
        mergedFlag = str(mergedFlag)

    requestString.append("&mergedFlag=%s"%(mergedFlag))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2067)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2067)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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'listStatusCD', u'listDate', u'delistDate', u'isPre', u'partyID', u'publishDate', u'endDateRep', u'fiscalPeriod', u'fiscalChgCD', u'mergedFlag', u'accoutingStandards', u'industryCategory', u'currencyCd', u'itemNO', u'itemCD', u'itemName', u'val', u'valLY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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','mergedFlag': 'str','accoutingStandards': 'str','industryCategory': 'str','currencyCd': '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 HKFdmtCFGet(secID = "", ticker = "", itemCD = "", listStatusCD = "", isPre = "", publishDateBegin = "", publishDateEnd = "", beginDate = "", endDate = "", mergedFlag = "", field = "", pandas = "1"):
    """
    获取港股上市公司现金流量表相关数据。1、对企业会计年度没有统一规定，公司可以根据自己的情况确定会计年度，按公司需要，也可变更年度结算日，故披露日期也较分散；2、对企业记账本位币没有特别要求，港交所上市企业来自全球，不同国家公司记账本位币很有可能不同，收录的为没有经过汇率处理的原始报表披露数据；3、对采用会计准则没有特别要求，企业可以根据实际情况确定会计准则，准则之间的差异有可能会导致同一名称科目结果有所差异，使用不同准则的公司横向可比性降低；4、若某家公司退市或转版，曾经使用过的交易代码可能会被分配给另一家公司，同一个ticker会有对应多家公司的可能性。
    
    :param secID: 证券展示代码,可以是列表,secID、ticker、itemCD至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker、itemCD至少选择一个
    :param itemCD: 科目代码。DataAPI.SysCodeGet.codeTypeID=70021&useType=VALUE_NUM_CD。,可以是列表,secID、ticker、itemCD至少选择一个
    :param listStatusCD: 上市状态,可空
    :param isPre: 是否历史证券代码；1-是（曾经使用该交易代码，现已退市或转版），0-否（现使用该交易代码）,可空
    :param publishDateBegin: 发布日期的起始日期，输入格式"YYYYMMDD",可空
    :param publishDateEnd: 发布日期的结束日期，输入格式"YYYYMMDD",可空
    :param beginDate: 报告会计期末的起始日期，输入格式"YYYYMMDD",可空
    :param endDate: 报告会计期末的结束日期，输入格式"YYYYMMDD",可空
    :param mergedFlag: 合并标志；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/fundamental/getHKFdmtCF.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    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(listStatusCD, str) and not isinstance(listStatusCD, unicode):
        listStatusCD = str(listStatusCD)

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

    requestString.append("&isPre=%s"%(isPre))
    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))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        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(mergedFlag, str) and not isinstance(mergedFlag, unicode):
        mergedFlag = str(mergedFlag)

    requestString.append("&mergedFlag=%s"%(mergedFlag))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2068)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2068)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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'listStatusCD', u'listDate', u'delistDate', u'isPre', u'partyID', u'publishDate', u'endDateRep', u'fiscalPeriod', u'fiscalChgCD', u'mergedFlag', u'accoutingStandards', u'industryCategory', u'currencyCd', u'itemNO', u'itemCD', u'itemName', u'val', u'valLY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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','mergedFlag': 'str','accoutingStandards': 'str','industryCategory': 'str','currencyCd': '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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 2156)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2156)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 2157)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2157)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 2158)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2158)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 2159)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2159)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 2160)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2160)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 2161)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2161)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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, 2162)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2162)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', 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, 2163)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2163)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'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'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, 2164)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2164)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', 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, 2165)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2165)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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 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, 2175)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2175)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 2204)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2204)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 2205)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2205)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 2206)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2206)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 2207)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2207)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 2208)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2208)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 2209)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2209)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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 = "", isNew = "", isCalc = "", publishDateEnd = "", publishDateBegin = "", 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 isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :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/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))
    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)
    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, 2210)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2210)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', 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, 2211)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2211)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'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'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, 2212)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2212)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', 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, 2213)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2213)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', 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 EquGet(equTypeCD = "", secID = "", ticker = "", listStatusCD = "", field = "", pandas = "1"):
    """
    获取股票的基本信息，包含股票交易代码及其简称、股票类型、上市状态、上市板块、上市日期等；上市状态为最新数据，不显示历史变动信息。
    
    :param equTypeCD: 股票分类编码。例如，A-A股；B-B股。,可以是列表,equTypeCD、secID、ticker至少选择一个
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,equTypeCD、secID、ticker至少选择一个
    :param ticker: 股票交易代码，如'000001',可以是列表,equTypeCD、secID、ticker至少选择一个
    :param listStatusCD: 上市状态。L-上市；S-暂停；DE-终止上市；UN-未上市。对应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/equity/getEqu.csv?ispandas=1&') 
    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("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_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, 106)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 106)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(isAllotment = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取股票历次配股的基本信息，包含每次配股方案的内容、方案进度、历史配股预案公布次数以及最终是否配股成功。
    
    :param isAllotment: 是否最终配股成功，0-不成功，1-成功。,可以是列表,isAllotment、secID、ticker至少选择一个
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,isAllotment、secID、ticker至少选择一个
    :param ticker: 股票交易代码，如'000001',可以是列表,isAllotment、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/getEquAllot.csv?ispandas=1&') 
    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)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 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, 109)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 109)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(exDivDate = "", eventProcessCD = "", secID = "", ticker = "", beginDate = "", endDate = "", beginPublishDate = "", endPublishDate = "", beginRecordDate = "", endRecordDate = "", field = "", pandas = "1"):
    """
    获取股票历次分红(派现、送股、转增股)的基本信息，包含历次分红预案的内容、实施进展情况以及历史宣告分红次数。
    
    :param exDivDate: 输入一个日期，格式“YYYYMMDD”，可以获取到这个输入日期当天的除权分红信息,exDivDate、eventProcessCD、secID、ticker至少选择一个
    :param eventProcessCD: 事件进程。例如，1-董事预案；3-股东大会否决。对应DataAPI.SysCodeGet.codeTypeID=20001。,可以是列表,exDivDate、eventProcessCD、secID、ticker至少选择一个
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,exDivDate、eventProcessCD、secID、ticker至少选择一个
    :param ticker: 股票交易代码，如'000001',可以是列表,exDivDate、eventProcessCD、secID、ticker至少选择一个
    :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&') 
    try:
        exDivDate = exDivDate.strftime('%Y%m%d')
    except:
        exDivDate = exDivDate.replace('-', '')
    requestString.append("exDivDate=%s"%(exDivDate))
    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("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 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))
    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, 108)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 108)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(industryVersionCD = "", industry = "", secID = "", ticker = "", intoDate = "", field = "", pandas = "1"):
    """
    输入证券ID或股票交易代码，获取股票所属行业分类
    
    :param industryVersionCD: 行业分类标准数字编码。010301-证监会行业V2012、010303-申万行业、010314-中证行业,industryVersionCD、industry、secID、ticker至少选择一个
    :param industry: 行业分类标准，模糊查询，如输入“申万”或"申万行业",industryVersionCD、industry、secID、ticker至少选择一个
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,industryVersionCD、industry、secID、ticker至少选择一个
    :param ticker: 股票交易代码，如"000001",可以是列表,industryVersionCD、industry、secID、ticker至少选择一个
    :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/equity/getEquIndustry.csv?ispandas=1&') 
    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))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 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))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 114)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 114)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIPOGet(beginDate = "", endDate = "", eventProcessCD = "", secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取股票首次公开发行上市的基本信息，包含股票首次公开发行的进程及发行结果。
    
    :param beginDate: 上市日期起始日期，可空，输入格式“YYYYMMDD”,beginDate、endDate、eventProcessCD、secID、ticker至少选择一个
    :param endDate: 上市日期截止日期，可空，输入格式“YYYYMMDD”,beginDate、endDate、eventProcessCD、secID、ticker至少选择一个
    :param eventProcessCD: 发行进程。例如，9-上市；10-撤销上市。对应DataAPI.SysCodeGet.codeTypeID=20001。,可以是列表,beginDate、endDate、eventProcessCD、secID、ticker至少选择一个
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,beginDate、endDate、eventProcessCD、secID、ticker至少选择一个
    :param ticker: 股票交易代码，如'000001',可以是列表,beginDate、endDate、eventProcessCD、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/getEquIPO.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("&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("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_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, 107)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 107)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 110)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 110)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(listStatusCD = "", secID = "", ticker = "", beginDate = "", dailyReturnNoReinvLower = "", dailyReturnNoReinvUpper = "", dailyReturnReinvLower = "", dailyReturnReinvUpper = "", endDate = "", isChgPctl = "", field = "", pandas = "1"):
    """
    获取股票每日回报率的基本信息，包含交易当天的上市状态、日行情以及除权除息事项的基本数据。
    
    :param listStatusCD: 上市状态。L-上市；S-暂停；DE-终止上市；UN-未上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,listStatusCD、secID、ticker至少选择一个
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,listStatusCD、secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,listStatusCD、secID、ticker至少选择一个
    :param beginDate: 根据交易日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param dailyReturnNoReinvLower: 根据不考虑红利再投资的日回报率范围查询的开始值,可空
    :param dailyReturnNoReinvUpper: 根据不考虑红利再投资的日回报率范围查询的结束值,可空
    :param dailyReturnReinvLower: 根据考虑红利再投资的日回报率范围查询的开始值,可空
    :param dailyReturnReinvUpper: 根据考虑红利再投资的日回报率范围查询的结束值,可空
    :param endDate: 根据交易日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :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("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("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 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(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))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    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, 113)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 113)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(beginDate = "", endDate = "", secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取股票进行股本拆细或者缩股的基本信息。
    
    :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/getEquSplits.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, 111)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 111)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(endDate = "", exchangeCD = "", beginDate = "", field = "", pandas = "1"):
    """
    获取上海、深圳交易所公布的每个交易日的融资融券交易汇总的信息，包括成交量、成交金额。本交易日可获取前一交易日的数据。
    
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param exchangeCD: 交易市场。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,可空
    :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/equity/getFstTotal.csv?ispandas=1&') 
    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:
        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, 115)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 115)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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至少选择一个
    :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/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, 116)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 116)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 = "", beginDate = "", endDate = "", partyID = "", 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 partyID: 机构ID，法人统一编码，可通过法人名称在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/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)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 112)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 112)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 1540)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1540)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 EquSHHKConsGet(exchangeCD = "", intoDate = "", isNew = "", field = "", pandas = "1"):
    """
    查询获取沪港通合资格股票名单，及历史调入、调出信息。
    
    :param exchangeCD: 交易市场。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所。对应DataAPI.SysCodeGet.codeTypeID=10002。,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, 1657)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1657)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 1867)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1867)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(beginDate = "", endDate = "", secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深市场A股机构调研统计，包括被调研机构代码与简称、调研日期、参与机构数量、披露日期等信息，不定时更新。
    
    :param beginDate: 起始调研日期，格式为YYYYMMDD,beginDate、endDate、secID、ticker至少选择一个
    :param endDate: 截止调研日期，格式为YYYYMMDD,beginDate、endDate、secID、ticker至少选择一个
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,beginDate、endDate、secID、ticker至少选择一个
    :param ticker: 证券交易代码，如'002642',可以是列表,beginDate、endDate、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/getEquIsActivity.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, 1868)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1868)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(eventID = "", secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深市场A股机构调研明细，包括被调研机构代码与简称、接待人员、参与调研的机构全称、调研机构类型、人员、调研内容等信息，不定时更新。
    
    :param eventID: 事件ID，可通过getEquIsActivity获取到。,可以是列表,eventID、secID、ticker至少选择一个
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,eventID、secID、ticker至少选择一个
    :param ticker: 证券交易代码，如'002642',可以是列表,eventID、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/getEquIsParticipantQa.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("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_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, 1869)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1869)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 RrpIPOApplyMRGet(ticker = "", onlineIssueCode = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    早报-新股申购
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param onlineIssueCode: 申购代码,可以是列表,可空
    :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/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:
        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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    早报-新股上市
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param onlineIssueCode: 申购代码,可以是列表,可空
    :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/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:
        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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    早报-新股中签率公布
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param onlineIssueCode: 申购代码,可以是列表,可空
    :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/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:
        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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    早报-新股缴款
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param onlineIssueCode: 申购代码,可以是列表,可空
    :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/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:
        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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    晚报-大宗交易
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param secShortName: 证券简称,可以是列表,可空
    :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/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:
        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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    早报-解禁
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param secShortName: 证券简称,可以是列表,可空
    :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/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:
        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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", endDateRecord = "", beginDateRecord = "", endDateExDiv = "", beginDateExDiv = "", field = "", pandas = "1"):
    """
    早报-分红
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param secShortName: 证券简称,可以是列表,可空
    :param endDateRecord: 根据股权登记日范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param beginDateRecord: 根据股权登记日范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDateExDiv: 根据除权除息日范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param beginDateExDiv: 根据除权除息日范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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:
        endDateRecord = endDateRecord.strftime('%Y%m%d')
    except:
        endDateRecord = endDateRecord.replace('-', '')
    requestString.append("&endDateRecord=%s"%(endDateRecord))
    try:
        beginDateRecord = beginDateRecord.strftime('%Y%m%d')
    except:
        beginDateRecord = beginDateRecord.replace('-', '')
    requestString.append("&beginDateRecord=%s"%(beginDateRecord))
    try:
        endDateExDiv = endDateExDiv.strftime('%Y%m%d')
    except:
        endDateExDiv = endDateExDiv.replace('-', '')
    requestString.append("&endDateExDiv=%s"%(endDateExDiv))
    try:
        beginDateExDiv = beginDateExDiv.strftime('%Y%m%d')
    except:
        beginDateExDiv = beginDateExDiv.replace('-', '')
    requestString.append("&beginDateExDiv=%s"%(beginDateExDiv))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 EquSpoGet(beginListPublishDate = "", secID = "", endListPublishDate = "", ticker = "", beginRecordDate = "", beginDate = "", endRecordDate = "", endDate = "", beginShcPublishDate = "", spoTypeCD = "", endShcPublishDate = "", beginListDate = "", endListDate = "", field = "", pandas = "1"):
    """
    历次增发方案以及实施信息，包括发行价、发行量、发行费用的相关信息。
    
    :param beginListPublishDate: 起始上市公告日，输入格式“YYYYMMDD”,可空
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,可空
    :param endListPublishDate: 截止上市公告日，输入格式“YYYYMMDD”,可空
    :param ticker: 证券交易代码,可以是列表,可空
    :param beginRecordDate: 起始股权登记日，输入格式“YYYYMMDD”,可空
    :param beginDate: 预案的起始公布日期，输入格式“YYYYMMDD”,可空
    :param endRecordDate: 截止股权登记日，输入格式“YYYYMMDD”,可空
    :param endDate: 预案的结束公布日期，输入格式“YYYYMMDD”,可空
    :param beginShcPublishDate: 起始股东大会公告日，输入格式“YYYYMMDD”,可空
    :param spoTypeCD: 增发类型编码。例如，0101-公开增发；0102-非公开增发。对应DataAPI.SysCodeGet.codeTypeID=20019。,可以是列表,可空
    :param endShcPublishDate: 截止股东大会公告日，输入格式“YYYYMMDD”,可空
    :param beginListDate: 起始增发股份上市日，输入格式“YYYYMMDD”,可空
    :param endListDate: 截止增发股份上市日，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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&') 
    try:
        beginListPublishDate = beginListPublishDate.strftime('%Y%m%d')
    except:
        beginListPublishDate = beginListPublishDate.replace('-', '')
    requestString.append("beginListPublishDate=%s"%(beginListPublishDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 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:
        endListPublishDate = endListPublishDate.strftime('%Y%m%d')
    except:
        endListPublishDate = endListPublishDate.replace('-', '')
    requestString.append("&endListPublishDate=%s"%(endListPublishDate))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 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:
        beginRecordDate = beginRecordDate.strftime('%Y%m%d')
    except:
        beginRecordDate = beginRecordDate.replace('-', '')
    requestString.append("&beginRecordDate=%s"%(beginRecordDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endRecordDate = endRecordDate.strftime('%Y%m%d')
    except:
        endRecordDate = endRecordDate.replace('-', '')
    requestString.append("&endRecordDate=%s"%(endRecordDate))
    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))
    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)
    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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1894)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1894)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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'},  )
        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, 1910)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1910)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 1911)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1911)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)

    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', 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','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, 1908)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1908)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 1912)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1912)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 EquChmIpoGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    新股上市
    
    :param secID: 证券代码,格式是“数字.交易所代码”，如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/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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1965)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1965)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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'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, 1966)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1966)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 1981)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1981)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 1985)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1985)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 1986)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1986)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 EquMsChangesGet(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/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))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1987)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1987)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 1988)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1988)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 1989)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1989)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 1991)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1991)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 1992)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1992)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 1993)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1993)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 2004)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2004)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 2051)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2051)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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, 2052)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2052)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2053)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2053)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2054)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2054)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2055)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2055)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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, 2056)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2056)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 HeyeNeeqGet(updateTimeBegin = "", updateTimeEnd = "", listStatusCD = "", secID = "", ticker = "", transWayCD = "", field = "", pandas = "1"):
    """
    获取新三板股票的基本信息，包含股票交易代码及其简称、股票类型、上市状态、上市板块、上市日期、曾用名等
    
    :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 listStatusCD: 挂牌状态。L-上市；S-暂停；DE-终止上市；UN-未上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,可空
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,可空
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param transWayCD: 转让方式代码。1-协议；3-竞价；4：意向；5：大宗交易。对应DataAPI.SysCodeGet.codeTypeID=90021。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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&') 
    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("&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("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    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)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(listStatusCD = "", secID = "", ticker = "", BfListStatusCD = "", createTimeBegin = "", createTimeEnd = "", updateTimeBegin = "", updateTimeEnd = "", field = "", pandas = "1"):
    """
    获取新三板股票的挂牌信息，包含股票挂牌状态，挂牌审核进程，及相关中介机构，公司基本信息等
    
    :param listStatusCD: 挂牌状态。L-上市；S-暂停；DE-终止上市；UN-未上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,可空
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,可空
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :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("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("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2081)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2081)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 2082)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2082)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2083)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2083)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2084)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2084)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2085)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2085)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2086)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2086)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2087)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2087)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2088)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2088)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 2089)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2089)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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'ticker', 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','ticker': '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, 2090)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2090)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2091)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2091)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2092)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2092)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 2093)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2093)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2094)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2094)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(tradeDate = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    该表计算了个股的特质收益。
    
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,tradeDate、secID、ticker至少选择一个
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,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/equity/getRMSpecificRetDay.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)
    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, 2095)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2095)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2096)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2096)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(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/getRMCovarianceShort.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, 2097)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2097)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(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/getRMCovarianceLong.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, 2098)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2098)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2099)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2099)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2100)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2100)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2101)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2101)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 2115)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2115)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2116)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2116)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2117)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2117)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2118)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2118)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2119)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2119)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2120)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2120)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2121)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2121)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2122)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2122)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2123)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2123)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2124)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2124)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2143)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2143)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 2136)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2136)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 EquIpoPlanGet(beginDate = "", endDate = "", ticker = "", field = "", pandas = "1"):
    """
    记录IPO发行时间安排。
    
    :param beginDate: 发布时间(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 发布时间(截止)，输入格式“YYYYMMDD”,可空
    :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/getEquIpoPlan.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, 2137)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2137)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2138)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2138)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2139)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2139)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2144)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2144)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_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'},  )
        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, 2140)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2140)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2141)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2141)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2142)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2142)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2168)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2168)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2169)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2169)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2170)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2170)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2171)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2171)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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-并购重组委。对应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, 2172)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2172)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 2192)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2192)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2193)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2193)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2194)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2194)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2195)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2195)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2196)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2196)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", 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/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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)

    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'guatrType', 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 = {'guatrType': 'str','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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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-主板和中小企业板。对应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, 2200)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2200)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2201)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2201)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2202)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2202)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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'ticker', 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','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 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, 2249)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2249)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 HKEquGet(secID = "", ticker = "", listStatusCD = "", field = "", pandas = "1"):
    """
    获取香港交易所上市股票的基本信息，包含股票交易代码及其简称、股票类型、上市状态、上市板块、上市日期等；上市状态为最新状态。
    
    :param secID: 证券ID，证券统一编码，可通过交易代码在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, 148)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 148)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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'},  )
        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: 证券ID，证券统一编码，可通过交易代码在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, 149)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 149)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 = "", field = "", pandas = "1"):
    """
    沪港通额度信息，包括沪股通和港股通总额度、总额度余额、每日额度以及每日额度余额的信息。
    
    :param exchangeCD: 交易类型，XSSC表示港股通，SHSC表示沪股通。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,可空
    :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/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)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1788)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1788)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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(exchangeCD = "", tradeDate = "", field = "", pandas = "1"):
    """
    沪港通每日成交统计，包括沪股通和港股通每日的买入成交量、成交额，卖出成交量、成交额。
    
    :param exchangeCD: 交易类型，XSSC表示港股通，SHSC表示沪股通。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,可空
    :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/HKequity/getequSHHKstatsTD.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)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1891)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1891)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 = "", field = "", pandas = "1"):
    """
    沪港通十大成交股，包括沪股通和港股通每日总成交额排名前十的活跃股。
    
    :param exchangeCD: 交易类型，XSSC表示港股通，SHSC表示沪股通。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,可空
    :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/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)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1892)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1892)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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','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: 交易市场。例如，SZSC-深股通；XZSC-深圳证券交易所港股通。对应DataAPI.SysCodeGet.codeTypeID=10002,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, 1994)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1994)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 = "", field = "", pandas = "1"):
    """
    深港通额度信息，包括深股通和港股通总额度、总额度余额、每日额度以及每日额度余额的信息。
    
    :param exchangeCD: 交易市场。例如，SZSC-深股通；XZSC-深圳证券交易所港股通。对应DataAPI.SysCodeGet.codeTypeID=10002,可以是列表,可空
    :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/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)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1995)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1995)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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 = "", field = "", pandas = "1"):
    """
    深港通每日成交统计，包括深股通和港股通每日的买入成交量、成交额，卖出成交量、成交额。
    
    :param exchangeCD: 交易市场。例如，SZSC-深股通；XZSC-深圳证券交易所港股通。对应DataAPI.SysCodeGet.codeTypeID=10002,可以是列表,可空
    :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/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)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1996)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1996)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 = "", field = "", pandas = "1"):
    """
    深港通十大成交股，包括深股通和港股通每日总成交额排名前十的活跃股。
    
    :param exchangeCD: 交易市场。例如，SZSC-深股通；XZSC-深圳证券交易所港股通。对应DataAPI.SysCodeGet.codeTypeID=10002,可以是列表,可空
    :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/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)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1997)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1997)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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','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, field = "", pandas = "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/HKequity/getequSZHKForex.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, 1998)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1998)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    记录上交所发布的港股通交易的参考汇率及结算汇率。
    
    :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/HKequity/getEquSHHKforex.csv?ispandas=1&') 
    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, 2242)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2242)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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: 频度代码。A-年，S-半年，M-月，D-日，W-周，H-小时，Q-季，N-不定期，SM-半月，TM-两月，TD-旬，TW-两周，TY-三年，WD-日（工作日）,可以是列表,beginDate、endDate、frequencyCD、typeID至少选择一个
    :param typeID: 港股股票分类代码。如：0201020101-主板,0201020202-红筹股，0201020206-优先预托证券。可在DataAPI.SysCodeGet接口输入codeTypeID=50003获取到,可以是列表,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, 2263)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2263)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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"):
    """
    记录港股11大行业月度及年度主板及创业板行业成交、市盈率、市场规模数据，统计类别包括主板月度及年度数据、创业板月度及年度数据、H股月度及年度数据、红筹股月度及年度数据、主板合计、创业板合计、H股合计、红筹股合计等。
    
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,beginDate、endDate、frequencyCD、industryCD至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,beginDate、endDate、frequencyCD、industryCD至少选择一个
    :param frequencyCD: 频度代码。A-年，S-半年，M-月，D-日，W-周，H-小时，Q-季，N-不定期，SM-半月，TM-两月，TD-旬，TW-两周，TY-三年，WD-日（工作日）,可以是列表,beginDate、endDate、frequencyCD、industryCD至少选择一个
    :param industryCD: 行业分类。如0103060010-石油及天然气，0103060510-黄金及贵金属。可在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, 2264)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2264)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 BondGet(secID = "", ticker = "", typeID = "", exchangeCD = "", partyID = "", listStatusCD = "", field = "", pandas = "1"):
    """
    债券的基本面信息，涵盖了债券计息方式、付息频率、起息日、到期日、兑付形式等。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param typeID: 债券分类ID。例如，0202010101-国债；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 field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 117)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 117)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 BondCfGet(secID = "", ticker = "", beginDate = "", cashTypeCD = "", endDate = "", field = "", pandas = "1"):
    """
    债券在每个计息周期付息兑付的相关数据。日期区间默认为过去一年。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 现金流起始日，默认为1年前，输入格式“YYYYMMDD”,可空
    :param cashTypeCD: 现金流类型，默认为INTPAY。INTPAY-付息；CAPINTPAY-还本付息。对应DataAPI.SysCodeGet.codeTypeID=30014。,可以是列表,可空
    :param endDate: 现金流截止日，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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))
    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)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 131)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 131)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 130)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 130)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 126)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 126)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 121)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 121)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 124)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 124)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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'},  )
        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, 127)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 127)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 128)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 128)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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'},  )
        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, 129)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 129)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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'},  )
        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, 1413)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1413)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 1646)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1646)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 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, 1683)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1683)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 BondValuationCsiGet(tradeDate = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    中证债券估值
    
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部中证债券估值数据，输入格式“YYYYMMDD”,tradeDate、secID、ticker至少选择一个
    :param secID: 通联数据编制的证券唯一标识ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,tradeDate、secID、ticker至少选择一个
    :param ticker: 债券交易代码,可以是列表,tradeDate、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/bond/getBondValuationCsi.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=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 BondAiHSGet(beginDate = "", endDate = "", secID = "", ticker = "", field = "", pandas = "1"):
    """
    正在上市的沪深债券截至到查询当日的应计利息。
    
    :param beginDate: 计息起始日，默认为1年前，输入格式“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/bond/getBondAiHS.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, 1821)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1821)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 FundGet(etfLof = "", secID = "", ticker = "", category = "", idxID = "", idxTicker = "", listStatusCd = "", operationMode = "", field = "", pandas = "1"):
    """
    获取基金的基本档案信息，包含基金名称、交易代码、分级情况、所属类别、保本情况、上市信息、相关机构、投资描述等信息。收录了2005年以来的历史数据，数据更新频率为不定期。
    
    :param etfLof: ETF或LOF型基金。取值为ETF或LOF或为空。对应DataAPI.SysCodeGet.codeTypeID=40004。,etfLof、secID、ticker、category、idxID、idxTicker、listStatusCd至少选择一个
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,etfLof、secID、ticker、category、idxID、idxTicker、listStatusCd至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"，"000001,000003",可以是列表,etfLof、secID、ticker、category、idxID、idxTicker、listStatusCd至少选择一个
    :param category: 按投资对象分基金类型。E-股票型，H-混合型，B-债券型，SB-短期理财债券，M-货币型，O-其他。对应DataAPI.SysCodeGet.codeTypeID=40002。,可以是列表,etfLof、secID、ticker、category、idxID、idxTicker、listStatusCd至少选择一个
    :param idxID: 指数型基金跟踪指数，为内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,etfLof、secID、ticker、category、idxID、idxTicker、listStatusCd至少选择一个
    :param idxTicker: 指数代码,etfLof、secID、ticker、category、idxID、idxTicker、listStatusCd至少选择一个
    :param listStatusCd: 上市状态。L-上市；S-暂停；DE-终止上市；UN-未上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,etfLof、secID、ticker、category、idxID、idxTicker、listStatusCd至少选择一个
    :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&') 
    if not isinstance(etfLof, str) and not isinstance(etfLof, unicode):
        etfLof = str(etfLof)

    requestString.append("etfLof=%s"%(etfLof))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    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("&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("&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, 133)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 133)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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'establishDate', u'listDate', u'delistDate', u'managementCompany', u'managementFullName', u'custodian', u'custodianFullName', u'investField', u'investTarget', u'perfBenchmark', u'circulationShares', u'isClass', u'idxID', u'idxTicker', u'idxShortName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_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','managementFullName': 'str','custodianFullName': 'str','investField': 'str','investTarget': 'str','perfBenchmark': 'str','idxID': 'str','idxTicker': 'str','idxShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundNavGet(dataDate = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取某只基金的历史净值数据(货币型、短期理财债券型除外),包括了单位份额净值、累计净值与复权净值。收录了2005年以来的历史数据，数据更新频率为日。
    
    :param dataDate: 输入一个日期，不输入其他请求参数，可获取到一天全部基金净值数据，输入格式“YYYYMMDD”,dataDate、secID、ticker至少选择一个
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,dataDate、secID、ticker至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,dataDate、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/getFundNav.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)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 134)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 134)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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'ACCUM_NAV', u'currencyCd', u'ADJUST_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 FundDivmGet(dataDate = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取某只货币型基金或短期理财债券型基金的历史收益情况，包含了每万份收益，七日年化收益率等信息。收录了2005年以来的历史数据，数据更新频率为日。不输入日期则默认获取近一年以来的历史数据。
    
    :param dataDate: 输入一个日期，不输入其他请求参数，可获取到一天全部基金历史收益数据，输入格式“YYYYMMDD”,dataDate、secID、ticker至少选择一个
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,dataDate、secID、ticker至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,dataDate、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/getFundDivm.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)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 135)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 135)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_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, 137)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 137)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(reportDate = "", secID = "", ticker = "", updateTime = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取基金定期披露的资产配置情况，包含了资产总值、资产净值，以及资产总值中权益类、固定收益类、现金及其他四种资产的市值与占比情况。收录了2005年以来的历史数据，数据更新频率为季度。获取方式支持：1）输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，一段时间的资产配置；2）输入reportDate,不输入其他参数，可以查询到输入日期的全部基金资产配置
    
    :param reportDate: 输入一个报告日期，如20141231，不输入其他请求参数，可获取这个报告期全部基金资产配置，输入格式“YYYYMMDD”,reportDate、secID、ticker、updateTime至少选择一个
    :param secID: 证券ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,reportDate、secID、ticker、updateTime至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,reportDate、secID、ticker、updateTime至少选择一个
    :param updateTime: 数据最新一次更新时间,reportDate、secID、ticker、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&') 
    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:
        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, 138)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 138)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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(reportDate = "", secID = "", ticker = "", beginDate = "", endDate = "", secType = "", field = "", pandas = "1"):
    """
    获取基金定期披露的持仓明细，包含所持有的股票、债券、基金的持仓明细数据。收录了2005年以来的历史数据，数据更新频率为季度。获取方式支持：1）输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，一段时间的基金持仓；2）输入reportDate,不输入其他参数，可以查询到输入日期的全部基金持仓数据。
    
    :param reportDate: 输入一个报告日期，如20141231，不输入其他请求参数，可获取这个报告期全部基金资产配置，输入格式“YYYYMMDD”,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 secType: 报告期内基金投资组合中持有证券类型。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/fund/getFundHoldings.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))
    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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 139)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 139)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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'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, 140)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 140)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 141)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 141)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 142)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 142)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 FundManagerGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取某只基金从成立以来，基金经理与基金经理助理的任职变动情况，包含基金经理的姓名，学历、性别、出生年、证书、入职时间和离职时间等。数据更新频率为不定期。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,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/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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1803)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1803)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 1461)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1461)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 1481)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1481)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 1502)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1502)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1787)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1787)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, 2125)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2125)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 FutuGet(exchangeCD = "", secID = "", ticker = "", contractStatus = "", contractObject = "", field = "", pandas = "1"):
    """
    获取国内四大期货交易所期货合约的基本要素信息，包括合约名称、合约代码、合约类型、合约标的、报价单位、最小变动价位、涨跌停板幅度、交易货币、合约乘数、交易保证金、上市日期、最后交易日、交割日期、交割方式、交易手续费、交割手续费、挂牌基准价、合约状态等。
    
    :param exchangeCD: 通联编制的证券市场编码。XZCE-郑州商品交易所， CCFX-中国金融期货交易所， XSGE-上海期货交易所，XDCE-大连期货交易所。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,exchangeCD、secID、ticker、contractStatus至少选择一个
    :param secID: 合约内部编码，可通过交易代码和证券类型在DataAPI.SecIDGet获取到。,可以是列表,exchangeCD、secID、ticker、contractStatus至少选择一个
    :param ticker: 合约交易代码，如'cu1106',可以是列表,exchangeCD、secID、ticker、contractStatus至少选择一个
    :param contractStatus: 期货合约状态。L-上市；DE-终止上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,exchangeCD、secID、ticker、contractStatus至少选择一个
    :param contractObject: 期货合约标的。例如，CU-阴极铜，AU-黄金。对应DataAPI.SysCodeGet.codeTypeID=60003。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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("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("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    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, 146)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 146)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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: 合约内部编码，可通过交易代码和证券类型在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 合约交易代码，如'cu1106',可以是列表,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, 147)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 147)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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: 通联编制的证券编码，格式是“交易代码.证券市场代码”（不绝对），如000001.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param ticker: 合约在交易市场通用的交易代码。,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param exchangeCD: 通联编制的证券市场编码。例如，XIBE-中国银行间市场；XSHE-深圳证券交易所等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,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, 2127)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2127)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 OptGet(secID = "", optID = "", ticker = "", varSecID = "", varticker = "", contractStatus = "", field = "", pandas = "1"):
    """
    获取期权合约编码，交易代码，交易市场，标的等相关信息
    
    :param secID: 证券ID，通联编制的证券唯一标识编码,可以是列表,secID、optID、ticker、varSecID、varticker、contractStatus至少选择一个
    :param optID: 合约编码，有交易所给出，标记唯一期权合约,可以是列表,secID、optID、ticker、varSecID、varticker、contractStatus至少选择一个
    :param ticker: 合约交易代码,可以是列表,secID、optID、ticker、varSecID、varticker、contractStatus至少选择一个
    :param varSecID: 标的证券ID,可以是列表,secID、optID、ticker、varSecID、varticker、contractStatus至少选择一个
    :param varticker: 标的交易代码,可以是列表,secID、optID、ticker、varSecID、varticker、contractStatus至少选择一个
    :param contractStatus: 合约状态，UN-未上市、L-上市、S-暂停上市、DE-退市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,secID、optID、ticker、varSecID、varticker、contractStatus至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1297)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1297)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 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, 1299)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1299)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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: 合约内部编码,通联编制的证券唯一标识编码,可以是列表,secID、optID、ticker、varSecID、varTicker、varType至少选择一个
    :param optID: 合约编码,由交易所给出，标记唯一期权合约,可以是列表,secID、optID、ticker、varSecID、varTicker、varType至少选择一个
    :param ticker: 合约交易代码,如:510180P1506M03500,可以是列表,secID、optID、ticker、varSecID、varTicker、varType至少选择一个
    :param varSecID: 标的内部编码,如:601318.XSHG 中国平安,可以是列表,secID、optID、ticker、varSecID、varTicker、varType至少选择一个
    :param varTicker: 标的交易代码，如:601318 中国平安,可以是列表,secID、optID、ticker、varSecID、varTicker、varType至少选择一个
    :param varType: 品种类别:E 股票期权；F ETF期权。对应DataAPI.SysCodeGet.codeTypeID=60101。,secID、optID、ticker、varSecID、varTicker、varType至少选择一个
    :param beginDate: 交易日期，查询开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日期，查询截止日期，输入格式“YYYYMMDD”,可空
    :param exerType: 期权履约方式:A 美式;E 欧式,可以是列表,可空
    :param contractType: 合约类型:CO 认购期权；PO 认沽期权；CP 认购、认沽期权。对应DataAPI.SysCodeGet.codeTypeID=60102。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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, 1656)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1656)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, secID = "", ticker = "", period = "", field = "", pandas = "1"):
    """
    获取期权合约标的证券历史波动率数据，包含5/10/30/60/90/120/180/250/500日历史波动率(通联自主计算)，目前只包含50ETF
    
    :param tradeDate: 交易日期，格式为YYYYMMDD,可以是列表
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可空
    :param ticker: 证券在证券市场通用的交易代码。,可空
    :param period: 历史波动率期限，这里可以输入5/10/30/60/90/120/180/250/500,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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(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(period, str) and not isinstance(period, unicode):
        period = str(period)

    requestString.append("&period=%s"%(period))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2059)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2059)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 MktOptVolatilityGet(secID = "", ticker = "", optID = "", tradeDate = "", field = "", pandas = "1"):
    """
    获取期权敏感度指标及期权估值信息，期权合约价格按照BS模型计算，利率采用银行间1年期存款基准利率（通联自主计算）
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、optID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、optID至少选择一个
    :param optID: 合约的唯一标识，由交易所给出。,可以是列表,secID、ticker、optID至少选择一个
    :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/options/getMktOptVolatility.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_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:
        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, 2060)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2060)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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'tradeDate', u'secShortName', u'exchangeCD', u'varClosePrice', u'strikePrice', u'contractType', u'settlePrice', u'IV', u'turnoverVol', u'optCalPrice', u'delta', u'gamma', u'theta', u'vega', u'rho', u'omega']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_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','contractType': '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, 2133)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2133)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2188)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2188)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 IdxGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取国内外指数的基本要素信息，包括指数名称、指数代码、发布机构、发布日期、基日、基点等。
    
    :param secID: 合约内部编码，可通过交易代码和证券类型在DataAPI.SecIDGet获取到。,可以是列表,可空
    :param ticker: 指数代码，可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型'IDX',输入secID'1',可获取到ticker'000001',在此输入'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/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)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 144)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 144)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "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'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def IdxConsGet(secID = "", ticker = "", intoDate = "", isNew = "", field = "", pandas = "1"):
    """
    获取国内外指数的成分构成情况，包括指数成分股名称、成分股代码、入选日期、剔除日期等。
    
    :param secID: 合约内部编码，可通过交易代码和证券类型在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 指数代码，可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型'IDX',输入SECURITY_ID'1',可获取到TICKER_SYMBOL'000001',在此输入'000001',可以是列表,secID、ticker至少选择一个
    :param intoDate: 输入日期，可以获取这一天证券的指数成分，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新，0为非最新，1为最新。对应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/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)
    try:
        intoDate = intoDate.strftime('%Y%m%d')
    except:
        intoDate = intoDate.replace('-', '')
    requestString.append("&intoDate=%s"%(intoDate))
    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, 145)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 145)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 IdxCsiDivGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取中证指数除数信息，包括上证180、上证50、沪深300、中证500指数的每日除数信息。
    
    :param secID: 合约内部编码，可通过交易代码和证券类型在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 指数代码，可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型'IDX',输入SECURITY_ID'1',可获取到TICKER_SYMBOL'000001',在此输入'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/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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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: 指数代码，可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型'IDX',输入SECURITY_ID'1',可获取到TICKER_SYMBOL'000001',在此输入'000001',可以是列表,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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 IdxCloseWeightGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取指数成分股权重，获取信息包括成分股名称、成分股代码、权重生效日、成分股权重等。其中，中债指数权重按日更新，其余指数权重按月更新。
    
    :param secID: 合约内部编码，可通过交易代码和证券类型在DataAPI.SecIDGet获取到。,secID、ticker至少选择一个
    :param ticker: 指数代码，指数编制或发布机构提供的代码，如沪深300为“000300”。当前提供的指数是000001-上证综指，000002-A股指数，000003-B股指数，000004-工业指数，000005-商业指数，000006-地产指数，000007-公用指数，000008-综合指数，000009-上证380，000010-上证180，000011-上证基金，000016-上证50，000020-中型综指，000090-上证流通，000132-上证100，000133-上证150，000300-沪深300，000852-中证1000，000902-中证流通，000903-中证100，000904-中证200，000905-中证500，000906-中证800，000907-中证700，399002-成份A指，399004-深证100R，399005-中小板指，399006-创业板指，399007-深证300，399008-中小300，399009-深证200，399010-深证700，399011-深证1000，399012-创业300，399013-深市精选，399015-中小创新，399107-深证A指，399108-深证B指，399306-深证ETF，399330-深证100，399333-中小板R，399400-大中盘，399401-中小盘,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, 1640)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1640)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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: 证券市场通用的指数代码。如沪深300为“000300”。当前提供的指数是000001-上证综指，000002-A股指数，000003-B股指数，000004-工业指数，000005-商业指数，000006-地产指数，000007-公用指数，000008-综合指数，000009-上证380，000010-上证180，000011-上证基金，000016-上证50，000020-中型综指，000090-上证流通，000132-上证100，000133-上证150，000300-沪深300，000852-中证1000，000902-中证流通，000903-中证100，000904-中证200，000905-中证500，000906-中证800，000907-中证700，399002-成份A指，399004-深证100R，399005-中小板指，399006-创业板指，399007-深证300，399008-中小300，399009-深证200，399010-深证700，399011-深证1000，399012-创业300，399013-深市精选，399015-中小创新，399107-深证A指，399108-深证B指，399306-深证ETF，399330-深证100，399333-中小板R，399400-大中盘，399401-中小盘,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, 1905)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1905)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 PfundNavGet(secIDInt = "", secID = "", secFullName = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    获取私募基金净值、累计净值数据
    
    :param secIDInt: 私募基金内部整型编码,可通过私募基金基本信息表getPfund获取,可以是列表,secIDInt、secID、secFullName、endDate、beginDate至少选择一个
    :param secID: 私募基金内部编码,可通过私募基金基本信息表getPfund获取,可以是列表,secIDInt、secID、secFullName、endDate、beginDate至少选择一个
    :param secFullName: 私募基金全称,secIDInt、secID、secFullName、endDate、beginDate至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,secIDInt、secID、secFullName、endDate、beginDate至少选择一个
    :param beginDate: 开始日期，输入格式“YYYYMMDD”,secIDInt、secID、secFullName、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/pfund/getPfundNav.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)
    if not isinstance(secFullName, str) and not isinstance(secFullName, unicode):
        secFullName = str(secFullName)

    requestString.append("&secFullName=%s"%(secFullName))
    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, 1979)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1979)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 = "", secFullName = "", pfStyleCD = "", statusCD = "", invStgyCD = "", secIDInt = "", field = "", pandas = "1"):
    """
    获取私募基本信息
    
    :param secID: 私募基金内部编码,可通过私募基金基本信息表getPfund获取,可以是列表,secID、secFullName、pfStyleCD、statusCD、invStgyCD、secIDInt至少选择一个
    :param secFullName: 私募基金全称,secID、secFullName、pfStyleCD、statusCD、invStgyCD、secIDInt至少选择一个
    :param pfStyleCD: 产品类型，1-自主发行；2-有限合伙等。对应DataAPI.SysCodeGet.codeTypeID=40031。,可以是列表,secID、secFullName、pfStyleCD、statusCD、invStgyCD、secIDInt至少选择一个
    :param statusCD: 运行状态，100-正常；202-到期清算等。对应DataAPI.SysCodeGet.codeTypeID=40034。,可以是列表,secID、secFullName、pfStyleCD、statusCD、invStgyCD、secIDInt至少选择一个
    :param invStgyCD: 投资策略，1-股票策略；2-相对价值等。对应DataAPI.SysCodeGet.codeTypeID=40032。,可以是列表,secID、secFullName、pfStyleCD、statusCD、invStgyCD、secIDInt至少选择一个
    :param secIDInt: 私募基金内部整型编码,可以是列表,secID、secFullName、pfStyleCD、statusCD、invStgyCD、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/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)
    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("&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=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1980)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1980)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "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'},  )
        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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(frequency = "", unit = "", statType = "", region = "", country = "", currency = "", infoSource = "", beginTime = "", endTime = "", indicID = "", isPub = "", field = "", pandas = "1"):
    """
    宏观行业指标(产品用)，包含聚源等多个来源的宏观行业指标。输入指标代码或单位、频度等，获取相关指标信息。
    
    :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 indicID: 指标代码，可多值输入，为空则输出所有,可以是列表,可空
    :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("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))
    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(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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'infoSourceCD', u'memo', u'src', u'publishStatus', u'isUpdate', u'isPub', 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 = {'indicName': 'str','frequency': 'str','unit': 'str','statType': 'str','region': 'str','country': 'str','currency': 'str','infoSource': 'str','infoSourceCD': 'str','memo': 'str','src': '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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(beginTime = "", endTime = "", indicID = "", field = "", pandas = "1"):
    """
    通联原宏观行业最新期数据(产品用)，包含通联原宏观及行业的所有数据。输入指标ID，获取指标最新期数据。
    
    :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 indicID: 指标代码，可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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&') 
    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("&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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 __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, 1927)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1927)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1928)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1928)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1929)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1929)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1930)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1930)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1931)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1931)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1932)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1932)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1933)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1933)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1934)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1934)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1935)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1935)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1936)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1936)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1937)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1937)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1938)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1938)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1939)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1939)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1940)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1940)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1941)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1941)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1942)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1942)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1943)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1943)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1944)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1944)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1945)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1945)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1946)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1946)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1947)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1947)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1948)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1948)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1949)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1949)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1950)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1950)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1951)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1951)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1952)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1952)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1953)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1953)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1954)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1954)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1955)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1955)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 EcoInfoProGet(dyCD = "", isUpdate = "", indicID = "", parentID = "", indicName = "", field = "", pandas = "1"):
    """
    宏观行业经济指标表，收录国家统计局、统计年鉴、海关总署、财政部等来源的大量经济指标，以及发布频率、统计类型、数据起止日期、数据存储表、数据API等信息。
    
    :param dyCD: 展示代码,可以是列表,可空
    :param isUpdate: 指标是否还在持续更新数据，1-是；0-否,可空
    :param indicID: 指标代码,可以是列表,可空
    :param parentID: 父节点代码,用来查找该代码下一层级的指标，可多值输入,可以是列表,可空
    :param indicName: 指标展示中文名,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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("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("&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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1973)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1973)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'indicDisplayName', u'indicNameEN', u'level', u'dyCD', u'parentCD', u'displayOrder', u'isList', u'frequencyCD', u'frequency', u'unitCD', u'unit', u'statType', u'statTypeCN', u'regionCD', u'region', u'countryCD', u'country', u'currencyCD', u'currency', u'accuracy', u'memo', u'memoEN', u'infoSourceCD', u'infoSource', u'importance', u'importanceCN', u'publishStatus', u'publishStatusCN', u'isPub', u'isUpdate', u'isFORMULA', u'dataTABLE', u'originSrcCD', 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 = {'indicName': 'str','indicDisplayName': 'str','indicNameEN': 'str','dyCD': 'str','parentCD': 'str','frequencyCD': 'str','frequency': 'str','unitCD': 'str','unit': 'str','statType': 'str','statTypeCN': 'str','regionCD': 'str','region': 'str','countryCD': 'str','country': 'str','currencyCD': 'str','currency': 'str','memo': 'str','memoEN': 'str','infoSourceCD': 'str','infoSource': 'str','importanceCN': 'str','publishStatusCN': 'str','dataTABLE': 'str','originSrcCD': '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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2226)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2226)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(beginDate, category = "", district = "", endDate = "", field = "", pandas = "1"):
    """
    包含家用电器行业分地区产量数据，如当月数量、上月数量、当月累计、月同比增长、累计同比增长等数据，具体内容可参见数据样例；历史数据从2015年2月开始，数据按月更新。
    
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”
    :param category: 类型，可模糊查询,category、district至少选择一个
    :param district: 地区，可模糊查询,category、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/getSbjHouseAppOutput.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(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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2227)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2227)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(category = "", beginDate = "", customCD = "", product = "", endDate = "", field = "", pandas = "1"):
    """
    包含家用电器行业分产品出口数据，如当期出口、累计出口、去年同期出口等数据，具体内容可参见数据样例；历史数据从2015年2月开始，数据按月更新。
    
    :param category: 类型，可模糊查询,category、beginDate至少选择一个
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”,category、beginDate至少选择一个
    :param customCD: 海关税号，可模糊查询,可空
    :param product: 商品名称，可模糊查询,可空
    :param endDate: 截止日期，所查询的数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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&') 
    if not isinstance(category, str) and not isinstance(category, unicode):
        category = str(category)

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

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

    requestString.append("&product=%s"%(product))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2228)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2228)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'valueUnit', 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','valueUnit': '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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2229)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2229)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2230)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2230)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2231)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2231)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2232)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2232)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'publishDate', u'companyName', u'reportType', u'ratingContent', u'ratingChange', u'abstractText']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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','ratingContent': 'str','ratingChange': 'str','abstractText': '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"):
    """
    包含雪球社交统计数据，输入一个或多个证券交易代码、统计起止日期，获取该证券一段时间内每天的雪球帖子数量、帖子占比(%)。
    
    :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, 1283)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1283)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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"):
    """
    包含按单只证券代码获取的雪球社交数据，输入一个证券交易代码，获取该证券每天的雪球帖子数量、及帖子占比(%)。
    
    :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, 1284)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1284)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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"):
    """
    包含按单个统计日期获取的雪球社交数据，输入一个统计日期，获取当天雪球帖子涉及的所有证券、各证券雪球帖子数量、帖子占比(%)。
    
    :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, 1285)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1285)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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，可多值输入,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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, 1286)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1286)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(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/getNewsInfoByTime.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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1287)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1287)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 1360)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1360)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1361)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1361)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1300)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1300)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1301)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1301)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1288)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1288)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(secID = "", ticker = "", secShortName = "", exchangeCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    包含证券相关的新闻数据，同时可获取针对不同证券的新闻情感数据。输入证券代码或简称、查询的新闻发布起止时间，同时可输入证券交易所代码，获取相关新闻数据，如：新闻ID、新闻标题、发布来源、发布时间、入库时间等。(注：1、自2014/1/1起新闻来源众多、新闻量日均4万左右，2013年及之前的网站来源少、新闻数据量少；2、数据实时更新。)
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到，可多值输入，如："000001.XSHE"、"000001.XSHE,600001.XSHG",可以是列表,secID、ticker、secShortName至少选择一个
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,secID、ticker、secShortName至少选择一个
    :param secShortName: 证券简称，支持模糊查询,secID、ticker、secShortName至少选择一个
    :param exchangeCD: 证券交易所代码(通联自编)。可选：XSHG、XSHE、XHKG、XNYS。XSHG表示上海证券交易所，XSHE表示深圳证券交易所，XHKG表示香港交易所，XNYS表示纽约证券交易所。可多值输入,可以是列表,可空
    :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/getNewsByTickers.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 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)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1289)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1289)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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(exchangeCD = "", ticker = "", secShortName = "", beginDate = "", endDate = "", secID = "", field = "", pandas = "1"):
    """
    包含证券相关的新闻热度指数数据，输入一个或多个证券交易代码、起止日期，获取该证券一段时间内的新闻热度指数(即证券当天关联新闻数量占当天新闻总量的百分比(%))。每天更新。（注：1、2014/1/1起新闻来源众多、指数统计有效，2013年及之前的网站来源不全、数据波动大，数据自2004/10/28始；2、新闻量的统计口径为经算法处理后证券关联到的所有常规新闻；3、数据按日更新。)
    
    :param exchangeCD: 证券交易所代码(通联自编)。可选：XSHG、XSHE、XHKG。XSHG表示上海证券交易所，XSHE表示深圳证券交易所，XHKG表示香港交易所。可多值输入,可以是列表,可空
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,可空
    :param secShortName: 证券简称，支持模糊查询,可空
    :param beginDate: 查询开始日期，默认为一个月前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :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&') 
    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))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1322)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1322)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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(exchangeCD = "", ticker = "", secShortName = "", beginDate = "", endDate = "", secID = "", field = "", pandas = "1"):
    """
    包含证券相关的新闻情感指数数据，输入一个或多个证券交易代码、起止日期，获取该证券一段时间内的新闻情感指数(即当天证券关联新闻的情感均值)。（注：1、2014/1/1起新闻来源众多、指数统计有效，2013年及之前的网站来源不全、数据波动大，数据自2004/10/28始；2、新闻量的统计口径为经算法处理后证券关联到的所有常规新闻；3、数据按日更新。)
    
    :param exchangeCD: 证券交易所代码(通联自编)。可选：XSHG、XSHE、XHKG。XSHG表示上海证券交易所，XSHE表示深圳证券交易所，XHKG表示香港交易所。可多值输入,可以是列表,可空
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,可空
    :param secShortName: 证券简称，支持模糊查询,可空
    :param beginDate: 查询开始日期，默认为一个月前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :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&') 
    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))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.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("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1323)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1323)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 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, 1324)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1324)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 = "", field = "", pandas = "1"):
    """
    根据公告分类获取相应公告信息，输入一个或多个公告分类，可以获取所查询证券相关的公告信息，包括公告ID、公告名称、证券交易场所、证券交易所对公告的原始分类、公告发布时间、公告所属分类、公告分类入库时间、更新时间。(注：公告分类数据自2009/1/5始，按日更新)
    
    :param beginDate: 查询开始日期，默认为30天前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param Category: 公告自动分类，分类包括：季度报告-业绩报告、中期报告-业绩报告、年度报告-业绩报告、业绩预报-业绩报告、业绩快报-业绩报告、招股说明书-首发公告、发行公告-首发公告、路演公告-首发公告、招股意向书-首发公告、定价公告-首发公告、受限股上市-股份变动、配股上市-股份变动、公积金转增-股份变动、持股变动-股权变动、股权变动-股权变动、股权收购-股权变动、要约收购-股权变动、吸收合并-股权变动、减资公告-股权变动、增发预案-增发公告、增发获准-增发公告、增发招股意向书-增发公告、发行公告-增发公告、上市公告-增发公告、激励计划-股权激励、对象名单-股权激励、进展公告-股权激励、配股预案-配股公告、配股说明书-配股公告、配股提示公告-配股公告、配股获准公告-配股公告、其他配股事项-配股公告、风险警示-上市资格、暂停上市-上市资格、恢复上市-上市资格、终止上市-上市资格、关联交易、资产重组、诉讼仲裁、高管变动、债券相关、政府补贴、违纪违规、担保事项、项目投资、股价异动、重大合同、重大损失、其他公告。分类单值输入。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1325)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1325)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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, 1326)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1326)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1419)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1419)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 1420)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1420)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 SocialDataGubaGet(ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    包含证券在股吧社交中的热度统计数据，输入一个或多个证券交易代码、统计起止日期，该证券在一段时间内每天相关的股吧帖子数量、帖子占比(%)。(注：数据自2014/1/1始，按日更新。)
    
    :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/getSocialDataGuba.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, 1431)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1431)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 SocialThemeDataGubaGet(themeID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    包含主题在股吧社交中的热度统计数据，输入一个或多个主题代码、统计起止日期，获取该主题在一段时间内每天相关的股吧帖子数量、帖子占比(%)。(注：数据自2014/1/1始，按日更新。)
    
    :param themeID: 主题代码，可多值输入,可以是列表,可空
    :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/getSocialThemeDataGuba.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=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 1432)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1432)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 1490)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1490)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 TickerNewsSentimentIndexGet(ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    包含股票相关的新闻情感指数数据，输入一个或多个证券交易代码、起止日期，获取该股票一段时间内的新闻情感指数(即股票当天关联到的正面新闻数量占该股票当天关联新闻总量的百分比(%))。每天实时刷新。
    
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,可空
    :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/getTickerNewsSentimentIndex.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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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(ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    包含股票相关的新闻社交热度指数数据，输入一个或多个证券交易代码、起止日期，获取该股票在一段时间内的社交热度(即该股票在股吧和雪球中的占比均值)、5日社交热度均值、5日均值变化率等。每天10点左右更新前一天的数据。
    
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,可空
    :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/getTickerSocialHeatIndex.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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    包含股票相关的新闻社交热度数据，输入一个或多个证券交易代码、起止日期，获取该股票在一段时间内的社交热度统计数据，包括每天该股票在雪球和股吧的帖子数量、帖子数量5日均值及帖子数量变化率等。每天10点左右更新前一天的数据。
    
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,可空
    :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/getTickerSocialHeat.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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 NewsBodyGet(newsID, field = "", pandas = "1"):
    """
    包含新闻全文信息，输入新闻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/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, 1579)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1579)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 1665)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1665)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1666)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1666)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 1990)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 1990)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 2007)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2007)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 NewsHeatIndexV2Get(secID = "", exchangeCD = "", ticker = "", secShortName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    包含证券相关的新闻热度指数数据，输入一个或多个证券交易代码、起止日期，获取该证券一段时间内的新闻热度指数(即证券当天关联新闻数量占当天新闻总量的百分比(%))。每天更新。（注：1、2014/1/1起新闻来源众多、指数统计有效，2013年及之前的网站来源不全、数据波动大，数据自2004/10/28始；2、新闻量的统计口径为经算法处理后证券关联到的所有常规新闻；3、数据按日更新。)
    
    :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 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/getNewsHeatIndexV2.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_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))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2102)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2102)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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(secID = "", exchangeCD = "", ticker = "", secShortName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    包含证券相关的新闻情感指数数据，输入一个或多个证券交易代码、起止日期，获取该证券一段时间内的新闻情感指数(即当天证券关联新闻的情感均值)。（注：1、2014/1/1起新闻来源众多、指数统计有效，2013年及之前的网站来源不全、数据波动大，数据自2004/10/28始；2、新闻量的统计口径为经算法处理后证券关联到的所有常规新闻；3、数据按日更新。)
    
    :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 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/getNewsSentimentIndexV2.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_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))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 2103)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2103)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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, 2128)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2128)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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, 2129)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2129)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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(themeID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取主题热度数据。包含主题ID、主题名称、整体热度分数、主题关联新闻数量、用主题词搜索新闻匹配的数量、计算热度的时间等信息。
    
    :param themeID: 主题ID，主题基本信息可从getTkgThemes中获得,可以是列表,可空
    :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/getTkgThemeHot.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, 2130)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2130)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2131)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2131)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2132)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2132)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 NewsIDGet(importantScore, effectiveDate, field = "", pandas = "1"):
    """
    通过生效时间及重要分数获取新闻ID，包含新闻ID、新闻生效时间、新闻重要分数。
    
    :param importantScore: 新闻重要分数
    :param effectiveDate: 新闻有效时间
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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&') 
    if not isinstance(importantScore, str) and not isinstance(importantScore, unicode):
        importantScore = str(importantScore)

    requestString.append("importantScore=%s"%(importantScore))
    try:
        effectiveDate = effectiveDate.strftime('%Y%m%d')
    except:
        effectiveDate = effectiveDate.replace('-', '')
    requestString.append("&effectiveDate=%s"%(effectiveDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2189)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2189)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, 2250)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2250)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2251)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2251)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2252)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2252)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2253)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2253)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2254)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2254)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2255)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2255)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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, 2256)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2256)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)

    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'bonusShareListDate', u'dividendTgt', u'isChg', u'recodChg', u'schDesc', u'updateTime', u'secID', u'ticker', u'secShortName', u'reportPeriod', u'eventChg', u'perShareDivPre', u'perShareDivAft', u'perShareDivRatio', u'perShareTransRatio', u'sharesBasic', u'sharesBasicDate', u'planPublishDate', u'shcPublishDate', u'publishDate', u'exDivDate', u'recordDate', u'cashDivDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dividendTgt': 'str','recodChg': 'str','schDesc': 'str','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 MktNeeqStatsGet(beginDate = "", endDate = "", statsFreq = "", statsItemCD = "", field = "", pandas = "1"):
    """
    统计新三板每日市场概况数据，包括挂牌公司家数、当日新增家数、总股本（亿股）、流通股本（亿股）、成交股票只数、成交金额（万元）、成交数量（万股）。
    
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param statsFreq: 统计项目的时间周期代码。A-年，S-半年，M-月，D-日，W-周，H-小时，Q-季，N-不定期，SM-半月，TM-两月，TD-旬，TW-两周，TY-三年，WD-日（工作日）,可以是列表,可空
    :param statsItemCD: 统计项目代码。1-挂牌公司家数，2-新增家数，3-总股本，4-流通股本，5-成交股票只数，6-成交金额，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/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=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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: 统计项目的时间周期代码。A-年，S-半年，M-月，D-日，W-周，H-小时，Q-季，N-不定期，SM-半月，TM-两月，TD-旬，TW-两周，TY-三年，WD-日（工作日）,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_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))
    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=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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: 统计类型。1-成交金额前10名，2-成交数量前10名，3-换手率前10名,可以是列表,statsType、statsFreq、ticker至少选择一个
    :param statsFreq: 统计周期。A-年，S-半年，M-月，D-日，W-周，H-小时，Q-季，N-不定期，SM-半月，TM-两月，TD-旬，TW-两周，TY-三年，WD-日（工作日）,可以是列表,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=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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 NeeqHoldersNumGet(secID = "", partyID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    1.记录新三板挂牌公司股东户数变化信息；2.数据范围：报告期、日常。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、partyID、ticker至少选择一个
    :param partyID: 机构内部ID,可以是列表,secID、partyID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、partyID、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/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("&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)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_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 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=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    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'},  )
        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, 2265)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2265)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2266)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2266)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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, 2267)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 2267)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\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 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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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'},  )
        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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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'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','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, -1)
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, -1)
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_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()

