Skip to content

Commit 5cdb425

Browse files
committed
feat: Establish package structure with __init__.py, add comprehensive KRX data tests, and update gitignore.
1 parent 46d3774 commit 5cdb425

4 files changed

Lines changed: 26 additions & 5 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ docs/build
1111
*.iml
1212
*~
1313
.vscode
14+
.venv
1415
.pytest_cache
16+
.env
17+
.env.example
1518

1619
# pyenv
1720
.python-version

src/FinanceDataReader/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from .data import (EtfListing)
55
from .chart import (plot)
66

7-
__version__ = '0.9.101'
7+
__version__ = '0.9.102'
88

99
__all__ = [
1010
'__version__',

tests/test_basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,10 @@ def test_stocklisting_desc():
189189
@pytest.mark.krx_listings
190190
def test_krx_listing():
191191
df = fdr.StockListing('KRX-DELISTING') # 3500+ 종목 - KRX 상장폐지 종목 전체
192-
assert len(df) > 100
192+
assert len(df) > 10
193193

194194
df = fdr.StockListing('KRX-ADMINISTRATIVE') # 50+ 종목 - KRX 관리종목
195-
assert len(df) > 100
195+
assert len(df) > 10
196196

197197
df = fdr.StockListing('S&P500') # S&P500 종목
198198
assert len(df) >= 500

tests/test_krx.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ----------------------------------------------
2-
# import sys
3-
# sys.path.insert(0, r'G:\내 드라이브\g_dev\FinanceDataReader-dev\FinanceDataReader\src')
2+
import sys
3+
# sys.path.insert(0, r'D:dev\FinanceDataReader-dev\FinanceDataReader\src')
44

55
import FinanceDataReader as fdr
66
import pytest
@@ -14,6 +14,14 @@ def test_krx_stock_listing():
1414
assert 'Code' in df.columns
1515
assert 'Name' in df.columns
1616

17+
@pytest.mark.krx
18+
def test_krx_stock_listing_kosdaq():
19+
# Basic KOSDAQ listing
20+
KOSDAQ = fdr.StockListing('KOSDAQ')
21+
assert len(KOSDAQ) > 100
22+
assert 'Code' in KOSDAQ.columns
23+
assert 'Name' in KOSDAQ.columns
24+
1725
@pytest.mark.krx
1826
def test_krx_delisting_listing():
1927
# KRX Delisting
@@ -53,3 +61,13 @@ def test_krx_detail_reader():
5361
assert len(df) > 0
5462
except Exception as e:
5563
pytest.skip(f"KRX-DETAIL might be unstable or require specific environment: {e}")
64+
65+
@pytest.mark.krx
66+
def test_krx_stock_data_reader():
67+
print(fdr)
68+
stock_code = ['0004Y0', '0007C0', '0008Z0', '0009K0', '0010V0', '0013V0', '0015G0', '0015N0', '0015S0', '0030R0', '0037T0', '0041B0', '0041J0', '0041L0', '0044K0', '0054V0', '0068Y0', '0071M0', '0072Z0', '0088D0', '0091W0', '0093G0', '0096B0', '0096D0', '0097F0', '0098T0', '0099W0', '0099X0', '0101C0', '0105P0', '0120G0', '0126Z0']
69+
for code in stock_code:
70+
print(code)
71+
stock_data = fdr.DataReader(code, '2026-01-01')
72+
assert len(stock_data) > 0
73+
assert 'Close' in stock_data.columns

0 commit comments

Comments
 (0)