def _query(self, type, startdate = "", enddate = ""): enddate = enddate if enddate else xacom.today() chartType = self._getChartType(type) if chartType == 0: # 분 df = (Query("t8412", True).request({ "InBlock" : { "shcode" : self._shcode, "qrycnt" : 2000, "comp_yn" : "Y", "sdate" : startdate, "edate" : enddate, "ncnt" : type } },{ "OutBlock" : ("cts_date", "cts_time"), "OutBlock1" : DataFrame(columns=("date", "time", "open", "high", "low", "close", "jdiff_vol","sign")) }))["OutBlock1"] else: df = (Query("t8413", True).request({ "InBlock" : { "shcode" : self._shcode, "gubun" : chartType, "qrycnt" : 2000, "sdate" : startdate, "edate" : enddate, "comp_yn" : "Y" } },{ "OutBlock" : ("cts_date",), "OutBlock1" : DataFrame(columns=("date", "open", "high", "low", "close", "jdiff_vol","sign")) }))["OutBlock1"] return df
def _parseParam(self, param): p = {} today = xacom.today() for k,v in param.items(): if isinstance(v, (list, tuple)): if len(v) < 2: p[k] = [v[0], today] else: p[k] = v[:2] else: p[k] = [v, today] return p