CoreDotToday / CoreDotFinance

Get All Finance Data!
Apache License 2.0
7 stars 1 forks source link

int 형태의 symbol 이 들어왔을 때 동작 #85

Open DavidKimDY opened 3 years ago

DavidKimDY commented 3 years ago
from coredotfinance.data import KrxReader

krx = KrxReader(api_key = api_key)
# 1
krx.read( 5930, start = '2021-03-01', end = '2021-03-04')
# 2
krx.read( 5930, start = '2021-03-01', end = '2021-03-04', api = True)

했을 때 api를 사용하지 않았을 때는 동작하고 api를 사용했을 때는 오류가 남.

DavidKimDY commented 3 years ago

문제

상황

해결방법 모색

  1. 문제라고 인식하지 않는다. -> API 사용이 불가능 하기 때문에
  2. 상품의 종류별로 종목코드 패턴을 설정하고 필터링한다.
DavidKimDY commented 3 years ago

문제 상황

>>> krx.read('66', start='2021-04-01', end='2021-05-01')
CSA 코스믹
            close  change  change_ratio  open  high   low   volume  trading_value   market_cap  shares_outstanding
2021-04-30   2450     565         29.97  2450  2450  2325  1332609     3263748265  90826510250            37072045
2021-04-29   1885     435         30.00  1885  1885  1885   358254      675308790  69880804825            37072045
2021-04-28   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-27   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-26   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-23   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-22   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-21   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-20   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-19   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-16   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-15   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-14   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-13   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-12   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-09   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-08   1450       0          0.00     0     0     0        0              0  53754465250            37072045
2021-04-07   1450    -165        -10.22  1615  1750  1450   869562     1320604480  53754465250            37072045
2021-04-06   1615     140          9.49  1445  1835  1375  2668989     4467689660  59871352675            37072045
2021-04-05   1475    -200        -11.94  1665  1665  1475   760365     1154308865  54681266375            37072045
2021-04-02   1675    -130         -7.20  1785  1795  1605   834910     1405753220  62095675375            37072045
2021-04-01   1805    -105         -5.50  1890  1900  1770   463834      848391565  66915041225            37072045
>>> krx.search('CSA')
('CSA 코스믹', 'KR7083660001', '083660')
>>> krx.search('66')
('CSA 코스믹', 'KR7083660001', '083660')

문제 원인