opendart-fss 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opendart_fss/__init__.py +77 -0
- opendart_fss/_version.py +34 -0
- opendart_fss/api/__init__.py +19 -0
- opendart_fss/api/base.py +72 -0
- opendart_fss/api/disclosure.py +103 -0
- opendart_fss/api/financial.py +206 -0
- opendart_fss/api/major_event.py +1051 -0
- opendart_fss/api/registration.py +183 -0
- opendart_fss/api/report.py +821 -0
- opendart_fss/api/shareholder.py +51 -0
- opendart_fss/client.py +96 -0
- opendart_fss/constants.py +88 -0
- opendart_fss/exceptions.py +90 -0
- opendart_fss/models/__init__.py +124 -0
- opendart_fss/models/base.py +10 -0
- opendart_fss/models/disclosure.py +106 -0
- opendart_fss/models/financial.py +85 -0
- opendart_fss/models/major_event.py +863 -0
- opendart_fss/models/registration.py +186 -0
- opendart_fss/models/report.py +691 -0
- opendart_fss/models/shareholder.py +54 -0
- opendart_fss/verification/__init__.py +50 -0
- opendart_fss/verification/config.py +450 -0
- opendart_fss/verification/rate_limiter.py +92 -0
- opendart_fss/verification/reporter.py +255 -0
- opendart_fss/verification/runner.py +326 -0
- opendart_fss-0.1.0.dist-info/METADATA +308 -0
- opendart_fss-0.1.0.dist-info/RECORD +30 -0
- opendart_fss-0.1.0.dist-info/WHEEL +4 -0
- opendart_fss-0.1.0.dist-info/licenses/LICENSE +21 -0
opendart_fss/__init__.py
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""OpenDART FSS Python SDK.
|
|
2
|
+
|
|
3
|
+
금융감독원 전자공시시스템 OpenDART API를 위한 Python SDK입니다.
|
|
4
|
+
|
|
5
|
+
Example:
|
|
6
|
+
```python
|
|
7
|
+
import asyncio
|
|
8
|
+
from opendart_fss import OpenDartClient
|
|
9
|
+
|
|
10
|
+
async def main():
|
|
11
|
+
async with OpenDartClient(api_key="YOUR_API_KEY") as client:
|
|
12
|
+
# 공시 검색
|
|
13
|
+
disclosures = await client.disclosure.search(
|
|
14
|
+
corp_code="00126380",
|
|
15
|
+
bgn_de="20240101",
|
|
16
|
+
end_de="20241231"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
# 기업 개황
|
|
20
|
+
company = await client.disclosure.get_company("00126380")
|
|
21
|
+
print(f"회사명: {company.corp_name}")
|
|
22
|
+
print(f"대표자: {company.ceo_nm}")
|
|
23
|
+
|
|
24
|
+
# 재무제표 조회
|
|
25
|
+
financials = await client.financial.get_single_account(
|
|
26
|
+
corp_code="00126380",
|
|
27
|
+
bsns_year="2024",
|
|
28
|
+
reprt_code="11011" # 사업보고서
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
for item in financials:
|
|
32
|
+
print(f"{item.account_nm}: {item.thstrm_amount}")
|
|
33
|
+
|
|
34
|
+
asyncio.run(main())
|
|
35
|
+
```
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
from opendart_fss.client import OpenDartClient
|
|
39
|
+
from opendart_fss.constants import (
|
|
40
|
+
CorpClass,
|
|
41
|
+
DisclosureType,
|
|
42
|
+
FinancialStatementType,
|
|
43
|
+
ReportCode,
|
|
44
|
+
StatusCode,
|
|
45
|
+
)
|
|
46
|
+
from opendart_fss.exceptions import (
|
|
47
|
+
APIError,
|
|
48
|
+
AuthenticationError,
|
|
49
|
+
NotFoundError,
|
|
50
|
+
OpenDartError,
|
|
51
|
+
RateLimitError,
|
|
52
|
+
ServerError,
|
|
53
|
+
ValidationError,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
try:
|
|
57
|
+
from opendart_fss._version import __version__
|
|
58
|
+
except ImportError:
|
|
59
|
+
__version__ = "0.0.0" # fallback for editable installs without build
|
|
60
|
+
__all__ = [
|
|
61
|
+
# Client
|
|
62
|
+
"OpenDartClient",
|
|
63
|
+
# Constants
|
|
64
|
+
"StatusCode",
|
|
65
|
+
"ReportCode",
|
|
66
|
+
"CorpClass",
|
|
67
|
+
"DisclosureType",
|
|
68
|
+
"FinancialStatementType",
|
|
69
|
+
# Exceptions
|
|
70
|
+
"OpenDartError",
|
|
71
|
+
"APIError",
|
|
72
|
+
"AuthenticationError",
|
|
73
|
+
"RateLimitError",
|
|
74
|
+
"ValidationError",
|
|
75
|
+
"NotFoundError",
|
|
76
|
+
"ServerError",
|
|
77
|
+
]
|
opendart_fss/_version.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
TYPE_CHECKING = False
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from typing import Tuple
|
|
16
|
+
from typing import Union
|
|
17
|
+
|
|
18
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
20
|
+
else:
|
|
21
|
+
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
23
|
+
|
|
24
|
+
version: str
|
|
25
|
+
__version__: str
|
|
26
|
+
__version_tuple__: VERSION_TUPLE
|
|
27
|
+
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
30
|
+
|
|
31
|
+
__version__ = version = '0.1.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 1, 0)
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = None
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""OpenDART API 클래스."""
|
|
2
|
+
|
|
3
|
+
from opendart_fss.api.base import BaseAPI
|
|
4
|
+
from opendart_fss.api.disclosure import DisclosureAPI
|
|
5
|
+
from opendart_fss.api.financial import FinancialAPI
|
|
6
|
+
from opendart_fss.api.major_event import MajorEventAPI
|
|
7
|
+
from opendart_fss.api.registration import RegistrationAPI
|
|
8
|
+
from opendart_fss.api.report import ReportAPI
|
|
9
|
+
from opendart_fss.api.shareholder import ShareholderAPI
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"BaseAPI",
|
|
13
|
+
"DisclosureAPI",
|
|
14
|
+
"ReportAPI",
|
|
15
|
+
"FinancialAPI",
|
|
16
|
+
"ShareholderAPI",
|
|
17
|
+
"MajorEventAPI",
|
|
18
|
+
"RegistrationAPI",
|
|
19
|
+
]
|
opendart_fss/api/base.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""API 기본 클래스."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
import msgspec
|
|
7
|
+
|
|
8
|
+
from opendart_fss.constants import BASE_URL
|
|
9
|
+
from opendart_fss.exceptions import raise_for_status
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from opendart_fss.client import OpenDartClient
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class BaseAPI:
|
|
16
|
+
"""API 기본 클래스."""
|
|
17
|
+
|
|
18
|
+
def __init__(self, client: "OpenDartClient") -> None:
|
|
19
|
+
self._client = client
|
|
20
|
+
|
|
21
|
+
@property
|
|
22
|
+
def _http(self) -> httpx.AsyncClient:
|
|
23
|
+
return self._client._http
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def _api_key(self) -> str:
|
|
27
|
+
return self._client.api_key
|
|
28
|
+
|
|
29
|
+
async def _request[T: msgspec.Struct](
|
|
30
|
+
self,
|
|
31
|
+
method: str,
|
|
32
|
+
endpoint: str,
|
|
33
|
+
response_type: type[T],
|
|
34
|
+
*,
|
|
35
|
+
params: dict | None = None,
|
|
36
|
+
) -> T:
|
|
37
|
+
"""API 요청 수행."""
|
|
38
|
+
url = f"{BASE_URL}{endpoint}"
|
|
39
|
+
request_params = {"crtfc_key": self._api_key}
|
|
40
|
+
if params:
|
|
41
|
+
request_params.update({k: v for k, v in params.items() if v is not None})
|
|
42
|
+
|
|
43
|
+
response = await self._http.request(method, url, params=request_params)
|
|
44
|
+
response.raise_for_status()
|
|
45
|
+
|
|
46
|
+
result = msgspec.json.decode(response.content, type=response_type)
|
|
47
|
+
|
|
48
|
+
if hasattr(result, "status"):
|
|
49
|
+
raise_for_status(result.status, getattr(result, "message", None))
|
|
50
|
+
|
|
51
|
+
return result
|
|
52
|
+
|
|
53
|
+
async def _get[T: msgspec.Struct](
|
|
54
|
+
self,
|
|
55
|
+
endpoint: str,
|
|
56
|
+
response_type: type[T],
|
|
57
|
+
*,
|
|
58
|
+
params: dict | None = None,
|
|
59
|
+
) -> T:
|
|
60
|
+
"""GET 요청."""
|
|
61
|
+
return await self._request("GET", endpoint, response_type, params=params)
|
|
62
|
+
|
|
63
|
+
async def _download(self, endpoint: str, *, params: dict | None = None) -> bytes:
|
|
64
|
+
"""파일 다운로드 (ZIP, XML 등)."""
|
|
65
|
+
url = f"{BASE_URL}{endpoint}"
|
|
66
|
+
request_params = {"crtfc_key": self._api_key}
|
|
67
|
+
if params:
|
|
68
|
+
request_params.update({k: v for k, v in params.items() if v is not None})
|
|
69
|
+
|
|
70
|
+
response = await self._http.get(url, params=request_params)
|
|
71
|
+
response.raise_for_status()
|
|
72
|
+
return response.content
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"""DS001 공시정보 API."""
|
|
2
|
+
|
|
3
|
+
from opendart_fss.api.base import BaseAPI
|
|
4
|
+
from opendart_fss.models.disclosure import (
|
|
5
|
+
Company,
|
|
6
|
+
CompanyResponse,
|
|
7
|
+
Disclosure,
|
|
8
|
+
DisclosureListResponse,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class DisclosureAPI(BaseAPI):
|
|
13
|
+
"""공시정보 API (DS001)."""
|
|
14
|
+
|
|
15
|
+
async def search(
|
|
16
|
+
self,
|
|
17
|
+
*,
|
|
18
|
+
corp_code: str | None = None,
|
|
19
|
+
bgn_de: str | None = None,
|
|
20
|
+
end_de: str | None = None,
|
|
21
|
+
last_reprt_at: str | None = None,
|
|
22
|
+
pblntf_ty: str | None = None,
|
|
23
|
+
pblntf_detail_ty: str | None = None,
|
|
24
|
+
corp_cls: str | None = None,
|
|
25
|
+
sort: str | None = None,
|
|
26
|
+
sort_mth: str | None = None,
|
|
27
|
+
page_no: int | None = None,
|
|
28
|
+
page_count: int | None = None,
|
|
29
|
+
) -> list[Disclosure]:
|
|
30
|
+
"""공시검색.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
corp_code: 고유번호 (8자리)
|
|
34
|
+
bgn_de: 시작일 (YYYYMMDD)
|
|
35
|
+
end_de: 종료일 (YYYYMMDD)
|
|
36
|
+
last_reprt_at: 최종보고서만 검색여부 (Y/N)
|
|
37
|
+
pblntf_ty: 공시유형 (A~J)
|
|
38
|
+
pblntf_detail_ty: 공시상세유형
|
|
39
|
+
corp_cls: 법인구분 (Y/K/N/E)
|
|
40
|
+
sort: 정렬 기준 (date/crp/rpt)
|
|
41
|
+
sort_mth: 정렬 방법 (asc/desc)
|
|
42
|
+
page_no: 페이지 번호
|
|
43
|
+
page_count: 페이지당 건수 (최대 100)
|
|
44
|
+
|
|
45
|
+
Returns:
|
|
46
|
+
공시 목록
|
|
47
|
+
"""
|
|
48
|
+
response = await self._get(
|
|
49
|
+
"/api/list.json",
|
|
50
|
+
DisclosureListResponse,
|
|
51
|
+
params={
|
|
52
|
+
"corp_code": corp_code,
|
|
53
|
+
"bgn_de": bgn_de,
|
|
54
|
+
"end_de": end_de,
|
|
55
|
+
"last_reprt_at": last_reprt_at,
|
|
56
|
+
"pblntf_ty": pblntf_ty,
|
|
57
|
+
"pblntf_detail_ty": pblntf_detail_ty,
|
|
58
|
+
"corp_cls": corp_cls,
|
|
59
|
+
"sort": sort,
|
|
60
|
+
"sort_mth": sort_mth,
|
|
61
|
+
"page_no": page_no,
|
|
62
|
+
"page_count": page_count,
|
|
63
|
+
},
|
|
64
|
+
)
|
|
65
|
+
return response.items
|
|
66
|
+
|
|
67
|
+
async def get_company(self, corp_code: str) -> Company:
|
|
68
|
+
"""기업개황 조회.
|
|
69
|
+
|
|
70
|
+
Args:
|
|
71
|
+
corp_code: 고유번호 (8자리)
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
기업 개황 정보
|
|
75
|
+
"""
|
|
76
|
+
response = await self._get(
|
|
77
|
+
"/api/company.json",
|
|
78
|
+
CompanyResponse,
|
|
79
|
+
params={"corp_code": corp_code},
|
|
80
|
+
)
|
|
81
|
+
return response.to_company()
|
|
82
|
+
|
|
83
|
+
async def download_document(self, rcept_no: str) -> bytes:
|
|
84
|
+
"""공시서류 원본 다운로드.
|
|
85
|
+
|
|
86
|
+
Args:
|
|
87
|
+
rcept_no: 접수번호 (14자리)
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
ZIP 파일 바이트
|
|
91
|
+
"""
|
|
92
|
+
return await self._download(
|
|
93
|
+
"/api/document.xml",
|
|
94
|
+
params={"rcept_no": rcept_no},
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
async def download_corp_codes(self) -> bytes:
|
|
98
|
+
"""고유번호 전체 다운로드.
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
ZIP 파일 바이트 (CORPCODE.xml 포함)
|
|
102
|
+
"""
|
|
103
|
+
return await self._download("/api/corpCode.xml")
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"""DS003 정기보고서 재무정보 API."""
|
|
2
|
+
|
|
3
|
+
from opendart_fss.api.base import BaseAPI
|
|
4
|
+
from opendart_fss.models.financial import (
|
|
5
|
+
FinancialAccount,
|
|
6
|
+
FinancialAccountListResponse,
|
|
7
|
+
FinancialIndicator,
|
|
8
|
+
FinancialIndicatorListResponse,
|
|
9
|
+
XbrlTaxonomy,
|
|
10
|
+
XbrlTaxonomyListResponse,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class FinancialAPI(BaseAPI):
|
|
15
|
+
"""정기보고서 재무정보 API (DS003)."""
|
|
16
|
+
|
|
17
|
+
async def get_single_account(
|
|
18
|
+
self,
|
|
19
|
+
corp_code: str,
|
|
20
|
+
bsns_year: str,
|
|
21
|
+
reprt_code: str,
|
|
22
|
+
fs_div: str = "CFS",
|
|
23
|
+
) -> list[FinancialAccount]:
|
|
24
|
+
"""단일회사 주요계정 조회.
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
corp_code: 고유번호 (8자리)
|
|
28
|
+
bsns_year: 사업연도 (YYYY)
|
|
29
|
+
reprt_code: 보고서 코드 (11011~11014)
|
|
30
|
+
fs_div: 개별/연결 구분 (CFS/OFS)
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
주요계정 목록
|
|
34
|
+
"""
|
|
35
|
+
response = await self._get(
|
|
36
|
+
"/api/fnlttSinglAcnt.json",
|
|
37
|
+
FinancialAccountListResponse,
|
|
38
|
+
params={
|
|
39
|
+
"corp_code": corp_code,
|
|
40
|
+
"bsns_year": bsns_year,
|
|
41
|
+
"reprt_code": reprt_code,
|
|
42
|
+
"fs_div": fs_div,
|
|
43
|
+
},
|
|
44
|
+
)
|
|
45
|
+
return response.items
|
|
46
|
+
|
|
47
|
+
async def get_multi_account(
|
|
48
|
+
self,
|
|
49
|
+
corp_code: str,
|
|
50
|
+
bsns_year: str,
|
|
51
|
+
reprt_code: str,
|
|
52
|
+
fs_div: str = "CFS",
|
|
53
|
+
) -> list[FinancialAccount]:
|
|
54
|
+
"""다중회사 주요계정 조회.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
corp_code: 고유번호 (쉼표로 구분, 최대 100개)
|
|
58
|
+
bsns_year: 사업연도 (YYYY)
|
|
59
|
+
reprt_code: 보고서 코드 (11011~11014)
|
|
60
|
+
fs_div: 개별/연결 구분 (CFS/OFS)
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
주요계정 목록
|
|
64
|
+
"""
|
|
65
|
+
response = await self._get(
|
|
66
|
+
"/api/fnlttMultiAcnt.json",
|
|
67
|
+
FinancialAccountListResponse,
|
|
68
|
+
params={
|
|
69
|
+
"corp_code": corp_code,
|
|
70
|
+
"bsns_year": bsns_year,
|
|
71
|
+
"reprt_code": reprt_code,
|
|
72
|
+
"fs_div": fs_div,
|
|
73
|
+
},
|
|
74
|
+
)
|
|
75
|
+
return response.items
|
|
76
|
+
|
|
77
|
+
async def get_full_statements(
|
|
78
|
+
self,
|
|
79
|
+
corp_code: str,
|
|
80
|
+
bsns_year: str,
|
|
81
|
+
reprt_code: str,
|
|
82
|
+
fs_div: str = "CFS",
|
|
83
|
+
) -> list[FinancialAccount]:
|
|
84
|
+
"""단일회사 전체 재무제표 조회.
|
|
85
|
+
|
|
86
|
+
Args:
|
|
87
|
+
corp_code: 고유번호 (8자리)
|
|
88
|
+
bsns_year: 사업연도 (YYYY)
|
|
89
|
+
reprt_code: 보고서 코드 (11011~11014)
|
|
90
|
+
fs_div: 개별/연결 구분 (CFS/OFS)
|
|
91
|
+
|
|
92
|
+
Returns:
|
|
93
|
+
전체 재무제표 계정 목록
|
|
94
|
+
"""
|
|
95
|
+
response = await self._get(
|
|
96
|
+
"/api/fnlttSinglAcntAll.json",
|
|
97
|
+
FinancialAccountListResponse,
|
|
98
|
+
params={
|
|
99
|
+
"corp_code": corp_code,
|
|
100
|
+
"bsns_year": bsns_year,
|
|
101
|
+
"reprt_code": reprt_code,
|
|
102
|
+
"fs_div": fs_div,
|
|
103
|
+
},
|
|
104
|
+
)
|
|
105
|
+
return response.items
|
|
106
|
+
|
|
107
|
+
async def download_xbrl(
|
|
108
|
+
self,
|
|
109
|
+
rcept_no: str,
|
|
110
|
+
reprt_code: str,
|
|
111
|
+
) -> bytes:
|
|
112
|
+
"""XBRL 원본파일 다운로드.
|
|
113
|
+
|
|
114
|
+
Args:
|
|
115
|
+
rcept_no: 접수번호 (14자리)
|
|
116
|
+
reprt_code: 보고서 코드 (11011~11014)
|
|
117
|
+
|
|
118
|
+
Returns:
|
|
119
|
+
ZIP 파일 바이트
|
|
120
|
+
"""
|
|
121
|
+
return await self._download(
|
|
122
|
+
"/api/fnlttXbrl.xml",
|
|
123
|
+
params={
|
|
124
|
+
"rcept_no": rcept_no,
|
|
125
|
+
"reprt_code": reprt_code,
|
|
126
|
+
},
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
async def get_xbrl_taxonomy(
|
|
130
|
+
self,
|
|
131
|
+
sj_div: str,
|
|
132
|
+
) -> list[XbrlTaxonomy]:
|
|
133
|
+
"""XBRL 택사노미 조회.
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
sj_div: 재무제표구분 (BS/IS/CIS/CF/SCE)
|
|
137
|
+
|
|
138
|
+
Returns:
|
|
139
|
+
택사노미 목록
|
|
140
|
+
"""
|
|
141
|
+
response = await self._get(
|
|
142
|
+
"/api/xbrlTaxonomy.json",
|
|
143
|
+
XbrlTaxonomyListResponse,
|
|
144
|
+
params={"sj_div": sj_div},
|
|
145
|
+
)
|
|
146
|
+
return response.items
|
|
147
|
+
|
|
148
|
+
async def get_indicators(
|
|
149
|
+
self,
|
|
150
|
+
corp_code: str,
|
|
151
|
+
bsns_year: str,
|
|
152
|
+
reprt_code: str,
|
|
153
|
+
idx_cl_code: str | None = None,
|
|
154
|
+
) -> list[FinancialIndicator]:
|
|
155
|
+
"""다중회사 재무지표 조회.
|
|
156
|
+
|
|
157
|
+
Args:
|
|
158
|
+
corp_code: 고유번호 (쉼표로 구분, 최대 100개)
|
|
159
|
+
bsns_year: 사업연도 (YYYY)
|
|
160
|
+
reprt_code: 보고서 코드 (11011~11014)
|
|
161
|
+
idx_cl_code: 지표분류코드 (선택)
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
재무지표 목록
|
|
165
|
+
"""
|
|
166
|
+
response = await self._get(
|
|
167
|
+
"/api/fnlttCmpnyIndx.json",
|
|
168
|
+
FinancialIndicatorListResponse,
|
|
169
|
+
params={
|
|
170
|
+
"corp_code": corp_code,
|
|
171
|
+
"bsns_year": bsns_year,
|
|
172
|
+
"reprt_code": reprt_code,
|
|
173
|
+
"idx_cl_code": idx_cl_code,
|
|
174
|
+
},
|
|
175
|
+
)
|
|
176
|
+
return response.items
|
|
177
|
+
|
|
178
|
+
async def get_single_indicators(
|
|
179
|
+
self,
|
|
180
|
+
corp_code: str,
|
|
181
|
+
bsns_year: str,
|
|
182
|
+
reprt_code: str,
|
|
183
|
+
idx_cl_code: str,
|
|
184
|
+
) -> list[FinancialIndicator]:
|
|
185
|
+
"""단일회사 주요 재무지표 조회.
|
|
186
|
+
|
|
187
|
+
Args:
|
|
188
|
+
corp_code: 고유번호 (8자리)
|
|
189
|
+
bsns_year: 사업연도 (YYYY, 2023년 3분기 이후)
|
|
190
|
+
reprt_code: 보고서 코드 (11011~11014)
|
|
191
|
+
idx_cl_code: 지표분류코드 (M210000~M240000)
|
|
192
|
+
|
|
193
|
+
Returns:
|
|
194
|
+
재무지표 목록
|
|
195
|
+
"""
|
|
196
|
+
response = await self._get(
|
|
197
|
+
"/api/fnlttSinglIndx.json",
|
|
198
|
+
FinancialIndicatorListResponse,
|
|
199
|
+
params={
|
|
200
|
+
"corp_code": corp_code,
|
|
201
|
+
"bsns_year": bsns_year,
|
|
202
|
+
"reprt_code": reprt_code,
|
|
203
|
+
"idx_cl_code": idx_cl_code,
|
|
204
|
+
},
|
|
205
|
+
)
|
|
206
|
+
return response.items
|