opendart-fss 0.1.0__py3-none-any.whl → 0.2.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 CHANGED
@@ -8,28 +8,31 @@ Example:
8
8
  from opendart_fss import OpenDartClient
9
9
 
10
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
- )
11
+ client = OpenDartClient(api_key="YOUR_API_KEY")
18
12
 
19
- # 기업 개황
20
- company = await client.disclosure.get_company("00126380")
21
- print(f"회사명: {company.corp_name}")
22
- print(f"대표자: {company.ceo_nm}")
13
+ # 공시 검색
14
+ disclosures = await client.disclosure.search(
15
+ corp_code="00126380",
16
+ bgn_de="20240101",
17
+ end_de="20241231"
18
+ )
23
19
 
24
- # 재무제표 조회
25
- financials = await client.financial.get_single_account(
26
- corp_code="00126380",
27
- bsns_year="2024",
28
- reprt_code="11011" # 사업보고서
29
- )
20
+ # 기업 개황
21
+ company = await client.disclosure.get_company("00126380")
22
+ print(f"회사명: {company.corp_name}")
23
+ print(f"대표자: {company.ceo_nm}")
30
24
 
31
- for item in financials:
32
- print(f"{item.account_nm}: {item.thstrm_amount}")
25
+ # 재무제표 조회
26
+ financials = await client.financial.get_single_account(
27
+ corp_code="00126380",
28
+ bsns_year="2024",
29
+ reprt_code="11011" # 사업보고서
30
+ )
31
+
32
+ for item in financials:
33
+ print(f"{item.account_nm}: {item.thstrm_amount}")
34
+
35
+ await client.close()
33
36
 
34
37
  asyncio.run(main())
35
38
  ```
opendart_fss/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.1.0'
32
- __version_tuple__ = version_tuple = (0, 1, 0)
31
+ __version__ = version = '0.2.0'
32
+ __version_tuple__ = version_tuple = (0, 2, 0)
33
33
 
34
34
  __commit_id__ = commit_id = None
opendart_fss/client.py CHANGED
@@ -1,7 +1,6 @@
1
1
  """OpenDART API 클라이언트."""
2
2
 
3
3
  import os
4
- from types import TracebackType
5
4
 
6
5
  import httpx
7
6
  from dotenv import load_dotenv
@@ -21,24 +20,27 @@ class OpenDartClient:
21
20
 
22
21
  Example:
23
22
  ```python
24
- async with OpenDartClient(api_key="YOUR_API_KEY") as client:
25
- # 공시 검색
26
- disclosures = await client.disclosure.search(
27
- corp_code="00126380",
28
- bgn_de="20240101",
29
- end_de="20241231"
30
- )
31
-
32
- # 기업 개황
33
- company = await client.disclosure.get_company("00126380")
34
- print(f"회사명: {company.corp_name}")
35
-
36
- # 재무제표 조회
37
- financials = await client.financial.get_single_account(
38
- corp_code="00126380",
39
- bsns_year="2024",
40
- reprt_code="11011"
41
- )
23
+ client = OpenDartClient(api_key="YOUR_API_KEY")
24
+
25
+ # 공시 검색
26
+ disclosures = await client.disclosure.search(
27
+ corp_code="00126380",
28
+ bgn_de="20240101",
29
+ end_de="20241231"
30
+ )
31
+
32
+ # 기업 개황
33
+ company = await client.disclosure.get_company("00126380")
34
+ print(f"회사명: {company.corp_name}")
35
+
36
+ # 재무제표 조회
37
+ financials = await client.financial.get_single_account(
38
+ corp_code="00126380",
39
+ bsns_year="2024",
40
+ reprt_code="11011"
41
+ )
42
+
43
+ await client.close() # 또는 contextlib.aclosing() 사용
42
44
  ```
43
45
  """
44
46
 
@@ -77,20 +79,9 @@ class OpenDartClient:
77
79
  self.major_event = MajorEventAPI(self)
78
80
  self.registration = RegistrationAPI(self)
79
81
 
80
- async def __aenter__(self) -> "OpenDartClient":
81
- """컨텍스트 매니저 진입."""
82
- return self
83
-
84
- async def __aexit__(
85
- self,
86
- _exc_type: type[BaseException] | None,
87
- _exc_val: BaseException | None,
88
- _exc_tb: TracebackType | None,
89
- ) -> None:
90
- """컨텍스트 매니저 종료."""
91
- await self.close()
92
-
93
- async def close(self) -> None:
82
+ async def aclose(self) -> None:
94
83
  """HTTP 클라이언트 종료."""
95
84
  if not self._external_client:
96
85
  await self._http.aclose()
86
+
87
+ close = aclose # alias
@@ -60,13 +60,12 @@ class EndpointVerifier:
60
60
  async def __aenter__(self) -> "EndpointVerifier":
61
61
  """컨텍스트 매니저 진입."""
62
62
  self._client = OpenDartClient(api_key=self._api_key)
63
- await self._client.__aenter__()
64
63
  return self
65
64
 
66
65
  async def __aexit__(self, *args: Any) -> None:
67
66
  """컨텍스트 매니저 종료."""
68
67
  if self._client:
69
- await self._client.__aexit__(*args)
68
+ await self._client.close()
70
69
 
71
70
  async def verify_all(
72
71
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opendart-fss
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: 금융감독원 전자공시시스템 OpenDART API Python SDK
5
5
  Project-URL: Homepage, https://github.com/hypn4/opendart-fss-python
6
6
  Project-URL: Documentation, https://github.com/hypn4/opendart-fss-python#readme
@@ -38,13 +38,13 @@ Description-Content-Type: text/markdown
38
38
  ## 설치
39
39
 
40
40
  ```bash
41
- pip install opendart-fss-python
41
+ pip install opendart-fss
42
42
  ```
43
43
 
44
44
  또는 uv 사용:
45
45
 
46
46
  ```bash
47
- uv add opendart-fss-python
47
+ uv add opendart-fss
48
48
  ```
49
49
 
50
50
  ## 빠른 시작
@@ -63,15 +63,13 @@ cp .env.example .env
63
63
 
64
64
  ```python
65
65
  # 환경변수가 설정되어 있으면 api_key 파라미터 생략 가능
66
- async with OpenDartClient() as client:
67
- ...
66
+ client = OpenDartClient()
68
67
  ```
69
68
 
70
69
  **2. 직접 전달**
71
70
 
72
71
  ```python
73
- async with OpenDartClient(api_key="YOUR_API_KEY") as client:
74
- ...
72
+ client = OpenDartClient(api_key="YOUR_API_KEY")
75
73
  ```
76
74
 
77
75
  ### 예제
@@ -81,31 +79,34 @@ import asyncio
81
79
  from opendart_fss import OpenDartClient
82
80
 
83
81
  async def main():
84
- async with OpenDartClient() as client: # 환경변수에서 API 키 로드
85
- # 공시 검색
86
- disclosures = await client.disclosure.search(
87
- corp_code="00126380",
88
- bgn_de="20240101",
89
- end_de="20241231"
90
- )
91
-
92
- for item in disclosures:
93
- print(f"{item.rcept_dt} - {item.report_nm}")
94
-
95
- # 기업 개황
96
- company = await client.disclosure.get_company("00126380")
97
- print(f"회사명: {company.corp_name}")
98
- print(f"대표자: {company.ceo_nm}")
99
-
100
- # 재무제표 조회
101
- financials = await client.financial.get_single_account(
102
- corp_code="00126380",
103
- bsns_year="2024",
104
- reprt_code="11011" # 사업보고서
105
- )
106
-
107
- for item in financials:
108
- print(f"{item.account_nm}: {item.thstrm_amount}")
82
+ client = OpenDartClient() # 환경변수에서 API 키 로드
83
+
84
+ # 공시 검색
85
+ disclosures = await client.disclosure.search(
86
+ corp_code="00126380",
87
+ bgn_de="20240101",
88
+ end_de="20241231"
89
+ )
90
+
91
+ for item in disclosures:
92
+ print(f"{item.rcept_dt} - {item.report_nm}")
93
+
94
+ # 기업 개황
95
+ company = await client.disclosure.get_company("00126380")
96
+ print(f"회사명: {company.corp_name}")
97
+ print(f"대표자: {company.ceo_nm}")
98
+
99
+ # 재무제표 조회
100
+ financials = await client.financial.get_single_account(
101
+ corp_code="00126380",
102
+ bsns_year="2024",
103
+ reprt_code="11011" # 사업보고서
104
+ )
105
+
106
+ for item in financials:
107
+ print(f"{item.account_nm}: {item.thstrm_amount}")
108
+
109
+ await client.close()
109
110
 
110
111
  asyncio.run(main())
111
112
  ```
@@ -1,6 +1,6 @@
1
- opendart_fss/__init__.py,sha256=dA5V3vMX6TD-iP_c7tRFZiLvwXqNVFjoOUxFIzjQbDU,1925
2
- opendart_fss/_version.py,sha256=5jwwVncvCiTnhOedfkzzxmxsggwmTBORdFL_4wq0ZeY,704
3
- opendart_fss/client.py,sha256=hdD3to71CU-H50UkdSl4AUY6Hgj_JUq8P02zinr0gtE,3049
1
+ opendart_fss/__init__.py,sha256=wPW8SPc1mQCsmwKhq3fOLUJBfwbEI-KCBcf5PyDrSXM,1871
2
+ opendart_fss/_version.py,sha256=Dg8AmJomLVpjKL6prJylOONZAPRtB86LOce7dorQS_A,704
3
+ opendart_fss/client.py,sha256=1e9idV8XJZuSOFD8QR-7nPAz9pJlyRUXMXdArRgvQmw,2673
4
4
  opendart_fss/constants.py,sha256=V1G-upQZrNePd0UfXRPinShazCWXnZ0BE3kS7r1OSME,2648
5
5
  opendart_fss/exceptions.py,sha256=hvIelIENuzFertBLAGUcI8fvMFnSbKyFpSg7ede5rEE,2349
6
6
  opendart_fss/api/__init__.py,sha256=-wvK7Yyu_8UBKpq9-PBbH5p5QsiLqd3roZqSOfPaUps,548
@@ -23,8 +23,8 @@ opendart_fss/verification/__init__.py,sha256=SZCKIILJgf-B4bv_NJ_bhlqRSKmlcMfQtFE
23
23
  opendart_fss/verification/config.py,sha256=Sx2PecTf1RseX6hjkACkijy_TpysQcIS2uNib9PftNw,12932
24
24
  opendart_fss/verification/rate_limiter.py,sha256=5sJBs1u4NTBURyLhTQJ64GoWVl36h10pn_iKAFgCqso,2725
25
25
  opendart_fss/verification/reporter.py,sha256=H8MvxbX75apI58imiE_62op1Ze4H-C3oClrkovcH36A,8451
26
- opendart_fss/verification/runner.py,sha256=FCrAuLb-VKaEG8p1cDuqnmtdYJFCF3eLdbMKG-Yawnk,10660
27
- opendart_fss-0.1.0.dist-info/METADATA,sha256=cJT4d0zlQmUDMkYlwa3blCyPVSarmy8Q1g7Fqe3LyZk,11982
28
- opendart_fss-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
29
- opendart_fss-0.1.0.dist-info/licenses/LICENSE,sha256=PsaoWGsqUAAHlgFddbvBZpOmnakIwB0c5HGkF27aepM,1062
30
- opendart_fss-0.1.0.dist-info/RECORD,,
26
+ opendart_fss/verification/runner.py,sha256=pXDnWANolIV5WfyvYBWpnBUGT46G1hDtYNQZfYW14zw,10611
27
+ opendart_fss-0.2.0.dist-info/METADATA,sha256=lx-F4m0xON4OKpMW9WAKcyKnW27RNuHd3HyGD8fgyDQ,11860
28
+ opendart_fss-0.2.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
29
+ opendart_fss-0.2.0.dist-info/licenses/LICENSE,sha256=PsaoWGsqUAAHlgFddbvBZpOmnakIwB0c5HGkF27aepM,1062
30
+ opendart_fss-0.2.0.dist-info/RECORD,,