출처 : https://github.com/FinanceData/FinanceDataReader
Install
pip3 install finance_datareader
Quick Start
import FinanceDataReader as fdr
# Apple(AAPL), 2017-01-01 ~ Now
df = fdr.DataReader('AAPL', '2017')
# AMAZON(AMZN), 2017
df = fdr.DataReader('AMZN', '2017-01-01', '2017-12-31')
# Samsung(005930), 1992-01-01 ~ 2018-10-31
df = fdr.DataReader('068270', '1992-01-01', '2018-10-31')
# country code: ex) 000150: Doosan(KR), Yihua Healthcare(CN)
df = fdr.DataReader('000150', '2018-01-01', '2018-10-30') # default: 'KR'
df = fdr.DataReader('000150', '2018-01-01', '2018-10-30', country='KR')
df = fdr.DataReader('000150', '2018-01-01', '2018-10-30', country='CN')
# KOSPI index, 2015~Now
df = fdr.DataReader('KS11', '2015-01-01')
# Dow Jones Industrial(DJI), 2015년~Now
df = fdr.DataReader('DJI', '2015-01-01')
# USD/KRW, 1995~Now
df = fdr.DataReader('USD/KRW', '1995-01-01')
# Bitcoin KRW price (Bithumbs), 2016 ~ Now
df = fdr.DataReader('BTC/KRW', '2016-01-01')
# KRX stock symbol list and names
df_krx = fdr.StockListing('KRX')
# S&P 500 symbol list
df_spx = fdr.StockListing('S&P500')
'Others > PYTHON' 카테고리의 다른 글
[ Link ] Plot (0) | 2019.12.13 |
---|---|
[ Link ] Pandas DataFrame (0) | 2019.11.28 |
[ PY ] 자료형 dict(딕셔너리) (구조의 추가/수정/삭제/관련함수) (0) | 2019.11.12 |
[ PY ] 파이썬 클래스, 모듈 정리 / 파이썬 자바 비교 (0) | 2019.11.12 |
[ 펌 ] 파이썬으로 주식 종목코드 가져오기 (0) | 2019.11.05 |