fdr.DataReader('KS11')
JSONDecodeError Traceback (most recent call last)
File ~\AppData\Roaming\Python\Python312\site-packages\requests\models.py:976, in Response.json(self, **kwargs)
975 try:
--> 976 return complexjson.loads(self.text, **kwargs)
977 except JSONDecodeError as e:
978 # Catch JSON-related errors and raise as requests.JSONDecodeError
979 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
File C:\ProgramData\anaconda3\Lib\json_init_.py:346, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
343 if (cls is None and object_hook is None and
344 parse_int is None and parse_float is None and
345 parse_constant is None and object_pairs_hook is None and not kw):
--> 346 return _default_decoder.decode(s)
347 if cls is None:
File C:\ProgramData\anaconda3\Lib\json\decoder.py:337, in JSONDecoder.decode(self, s, _w)
333 """Return the Python representation of s (a str instance
334 containing a JSON document).
335
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
File C:\ProgramData\anaconda3\Lib\json\decoder.py:355, in JSONDecoder.raw_decode(self, s, idx)
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
JSONDecodeError Traceback (most recent call last)
File ~\AppData\Roaming\Python\Python312\site-packages\FinanceDataReader\krx\data.py:51, in _krx_index_price_2years(idx1, idx2, from_date, to_date)
50 try:
---> 51 jo = r.json()
52 except:
File ~\AppData\Roaming\Python\Python312\site-packages\requests\models.py:980, in Response.json(self, **kwargs)
977 except JSONDecodeError as e:
978 # Catch JSON-related errors and raise as requests.JSONDecodeError
979 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
--> 980 raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
Cell In[8], line 1
----> 1 fdr.DataReader('KQ11')
File ~\AppData\Roaming\Python\Python312\site-packages\FinanceDataReader\data.py:67, in DataReader(symbol, start, end, exchange, data_source)
65 if symbol in krx_index_symbol_map:
66 symbol = krx_index_symbol_map[symbol]
---> 67 return KrxIndexReader(symbol, start, end).read()
69 # 1-2) yahoo major indices
70 yahoo_index_symbol_map = {
71 'DJI':'^DJI', 'IXIC':'^IXIC', 'US500':'^GSPC', 'S&P500':'^GSPC',
72 'RUT':'^RUT', 'VIX':'^VIX', 'N225':'^N225', 'SSEC':'000001.SS',
73 'FTSE':'^FTSE', 'HSI':'^HSI', 'FCHI':'^FCHI', 'GDAXI':'^GDAXI',
74 'US5YT':'^FVX', 'US10YT':'^TNX', 'US30YT':'^TYX', # US Treasury Bonds
75 }
File ~\AppData\Roaming\Python\Python312\site-packages\FinanceDataReader\krx\data.py:268, in KrxIndexReader.read(self)
266 def read(self):
267 idx1, idx2 = self.symbol[0], self.symbol[1:]
--> 268 df = _krx_index_price(idx1, idx2, self.start, self.end)
269 df.attrs = {'exchange':'KRX', 'source':'KRX', 'data':'INDEX'}
270 return df
File ~\AppData\Roaming\Python\Python312\site-packages\FinanceDataReader\krx\data.py:66, in _krx_index_price(idx1, idx2, from_date, to_date)
64 _end = datetime(_start.year+2, _start.month, _start.day) - timedelta(days=1)
65 while True:
---> 66 df = _krx_index_price_2years(idx1, idx2, _start, _end)
67 df_list.append(df)
68 if to_date <= _end:
File ~\AppData\Roaming\Python\Python312\site-packages\FinanceDataReader\krx\data.py:53, in _krx_index_price_2years(idx1, idx2, from_date, to_date)
51 jo = r.json()
52 except:
---> 53 raise ValueError(r.text)
55 return pd.DataFrame(r.json()['output'])
ValueError: LOGOUT
fdr.DataReader('KS11')
JSONDecodeError Traceback (most recent call last)
File ~\AppData\Roaming\Python\Python312\site-packages\requests\models.py:976, in Response.json(self, **kwargs)
975 try:
--> 976 return complexjson.loads(self.text, **kwargs)
977 except JSONDecodeError as e:
978 # Catch JSON-related errors and raise as requests.JSONDecodeError
979 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
File C:\ProgramData\anaconda3\Lib\json_init_.py:346, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
343 if (cls is None and object_hook is None and
344 parse_int is None and parse_float is None and
345 parse_constant is None and object_pairs_hook is None and not kw):
--> 346 return _default_decoder.decode(s)
347 if cls is None:
File C:\ProgramData\anaconda3\Lib\json\decoder.py:337, in JSONDecoder.decode(self, s, _w)
333 """Return the Python representation of
s(astrinstance334 containing a JSON document).
335
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
File C:\ProgramData\anaconda3\Lib\json\decoder.py:355, in JSONDecoder.raw_decode(self, s, idx)
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
JSONDecodeError Traceback (most recent call last)
File ~\AppData\Roaming\Python\Python312\site-packages\FinanceDataReader\krx\data.py:51, in _krx_index_price_2years(idx1, idx2, from_date, to_date)
50 try:
---> 51 jo = r.json()
52 except:
File ~\AppData\Roaming\Python\Python312\site-packages\requests\models.py:980, in Response.json(self, **kwargs)
977 except JSONDecodeError as e:
978 # Catch JSON-related errors and raise as requests.JSONDecodeError
979 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
--> 980 raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
Cell In[8], line 1
----> 1 fdr.DataReader('KQ11')
File ~\AppData\Roaming\Python\Python312\site-packages\FinanceDataReader\data.py:67, in DataReader(symbol, start, end, exchange, data_source)
65 if symbol in krx_index_symbol_map:
66 symbol = krx_index_symbol_map[symbol]
---> 67 return KrxIndexReader(symbol, start, end).read()
69 # 1-2) yahoo major indices
70 yahoo_index_symbol_map = {
71 'DJI':'^DJI', 'IXIC':'^IXIC', 'US500':'^GSPC', 'S&P500':'^GSPC',
72 'RUT':'^RUT', 'VIX':'^VIX', 'N225':'^N225', 'SSEC':'000001.SS',
73 'FTSE':'^FTSE', 'HSI':'^HSI', 'FCHI':'^FCHI', 'GDAXI':'^GDAXI',
74 'US5YT':'^FVX', 'US10YT':'^TNX', 'US30YT':'^TYX', # US Treasury Bonds
75 }
File ~\AppData\Roaming\Python\Python312\site-packages\FinanceDataReader\krx\data.py:268, in KrxIndexReader.read(self)
266 def read(self):
267 idx1, idx2 = self.symbol[0], self.symbol[1:]
--> 268 df = _krx_index_price(idx1, idx2, self.start, self.end)
269 df.attrs = {'exchange':'KRX', 'source':'KRX', 'data':'INDEX'}
270 return df
File ~\AppData\Roaming\Python\Python312\site-packages\FinanceDataReader\krx\data.py:66, in _krx_index_price(idx1, idx2, from_date, to_date)
64 _end = datetime(_start.year+2, _start.month, _start.day) - timedelta(days=1)
65 while True:
---> 66 df = _krx_index_price_2years(idx1, idx2, _start, _end)
67 df_list.append(df)
68 if to_date <= _end:
File ~\AppData\Roaming\Python\Python312\site-packages\FinanceDataReader\krx\data.py:53, in _krx_index_price_2years(idx1, idx2, from_date, to_date)
51 jo = r.json()
52 except:
---> 53 raise ValueError(r.text)
55 return pd.DataFrame(r.json()['output'])
ValueError: LOGOUT