opendart-client 0.1.0__tar.gz
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_client-0.1.0/.github/workflows/check.yml +13 -0
- opendart_client-0.1.0/.github/workflows/publish.yml +41 -0
- opendart_client-0.1.0/.github/workflows/reusable-check.yml +73 -0
- opendart_client-0.1.0/.gitignore +22 -0
- opendart_client-0.1.0/LICENSE +21 -0
- opendart_client-0.1.0/PKG-INFO +225 -0
- opendart_client-0.1.0/README.ko.md +195 -0
- opendart_client-0.1.0/README.md +197 -0
- opendart_client-0.1.0/pyproject.toml +75 -0
- opendart_client-0.1.0/src/opendartclient/__init__.py +60 -0
- opendart_client-0.1.0/src/opendartclient/_endpoint.py +47 -0
- opendart_client-0.1.0/src/opendartclient/client.py +92 -0
- opendart_client-0.1.0/src/opendartclient/disclosure.py +111 -0
- opendart_client-0.1.0/src/opendartclient/errors.py +77 -0
- opendart_client-0.1.0/src/opendartclient/event.py +294 -0
- opendart_client-0.1.0/src/opendartclient/finance.py +155 -0
- opendart_client-0.1.0/src/opendartclient/ownership.py +36 -0
- opendart_client-0.1.0/src/opendartclient/py.typed +0 -0
- opendart_client-0.1.0/src/opendartclient/registration.py +84 -0
- opendart_client-0.1.0/src/opendartclient/report.py +265 -0
- opendart_client-0.1.0/src/opendartclient/resolver.py +109 -0
- opendart_client-0.1.0/src/opendartclient/session.py +176 -0
- opendart_client-0.1.0/src/opendartclient/types.py +43 -0
- opendart_client-0.1.0/tests/__init__.py +0 -0
- opendart_client-0.1.0/tests/test_client.py +51 -0
- opendart_client-0.1.0/tests/test_contract.py +140 -0
- opendart_client-0.1.0/tests/test_disclosure.py +60 -0
- opendart_client-0.1.0/tests/test_edges.py +208 -0
- opendart_client-0.1.0/tests/test_hardening.py +172 -0
- opendart_client-0.1.0/tests/test_resolver.py +94 -0
- opendart_client-0.1.0/tests/test_session.py +121 -0
- opendart_client-0.1.0/tests/test_surfaces.py +93 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
name: check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
check:
|
|
11
|
+
# The full check lives in reusable-check.yml so the release gate in
|
|
12
|
+
# publish.yml runs the identical job.
|
|
13
|
+
uses: ./.github/workflows/reusable-check.yml
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: publish
|
|
2
|
+
|
|
3
|
+
# Publish to PyPI when a GitHub Release is published. Authentication is via PyPI
|
|
4
|
+
# Trusted Publishing (OIDC): no API token or password is stored anywhere -- GitHub
|
|
5
|
+
# mints a short-lived identity token that PyPI verifies against the publisher
|
|
6
|
+
# registered for this repo (owner seokhoonj / repo opendart-client / this workflow /
|
|
7
|
+
# environment "pypi").
|
|
8
|
+
#
|
|
9
|
+
# A release event fires this independently of check.yml, so a red build would
|
|
10
|
+
# otherwise upload anyway. The `gate` job runs the *same* reusable check -- the full
|
|
11
|
+
# 3.11/3.14 matrix, lint, types, zero-dependency and py.typed assertions -- on the
|
|
12
|
+
# release commit, and `publish` needs it: a failing suite cannot reach the upload.
|
|
13
|
+
|
|
14
|
+
on:
|
|
15
|
+
release:
|
|
16
|
+
types: [published]
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
gate:
|
|
20
|
+
uses: ./.github/workflows/reusable-check.yml
|
|
21
|
+
|
|
22
|
+
publish:
|
|
23
|
+
needs: gate
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
environment: pypi
|
|
26
|
+
permissions:
|
|
27
|
+
# Naming any permission drops every unnamed one to `none`, so `contents` must
|
|
28
|
+
# be listed back or checkout cannot read the repo (fails outright on a private
|
|
29
|
+
# repo, and is the safe default for a public one).
|
|
30
|
+
contents: read
|
|
31
|
+
id-token: write # required for OIDC; this is what replaces a stored token
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
34
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
35
|
+
with:
|
|
36
|
+
python-version: "3.12"
|
|
37
|
+
- name: Build sdist and wheel
|
|
38
|
+
run: |
|
|
39
|
+
python -m pip install --upgrade build
|
|
40
|
+
python -m build
|
|
41
|
+
- uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: reusable check
|
|
2
|
+
|
|
3
|
+
# The full check -- tests, lint, types, and the packaging assertions -- factored
|
|
4
|
+
# into one reusable job so both `check.yml` (on push / PR) and the release gate in
|
|
5
|
+
# `publish.yml` run the *identical* thing. One definition is what makes "publish
|
|
6
|
+
# gates on the full check" true; a second hand-maintained copy would drift.
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
workflow_call:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
check:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
# The floor and the current release. requires-python is >=3.11, so 3.11 is
|
|
18
|
+
# the version that claim has to hold on; the upper end tracks current CPython.
|
|
19
|
+
python-version: ["3.11", "3.14"]
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
23
|
+
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
|
24
|
+
|
|
25
|
+
- name: Install
|
|
26
|
+
run: |
|
|
27
|
+
uv venv --python ${{ matrix.python-version }}
|
|
28
|
+
uv pip install -e ".[dev]"
|
|
29
|
+
.venv/bin/python -c "import sys; print('testing on', sys.version)"
|
|
30
|
+
|
|
31
|
+
- name: Test
|
|
32
|
+
run: .venv/bin/pytest -q
|
|
33
|
+
|
|
34
|
+
- name: Lint
|
|
35
|
+
run: .venv/bin/ruff check src tests
|
|
36
|
+
|
|
37
|
+
- name: Types
|
|
38
|
+
run: .venv/bin/mypy
|
|
39
|
+
|
|
40
|
+
- name: Confirm the package still has no runtime dependencies
|
|
41
|
+
# The zero-dependency claim is in the README and pyproject; a claim nothing
|
|
42
|
+
# checks quietly stops being true. Installed into a bare environment, the
|
|
43
|
+
# package must import with nothing else present.
|
|
44
|
+
run: |
|
|
45
|
+
uv venv /tmp/bare --python ${{ matrix.python-version }}
|
|
46
|
+
uv pip install --python /tmp/bare/bin/python .
|
|
47
|
+
/tmp/bare/bin/python -c "
|
|
48
|
+
import importlib.metadata as md
|
|
49
|
+
requires = md.requires('opendart-client') or []
|
|
50
|
+
runtime = [r for r in requires if 'extra ==' not in r]
|
|
51
|
+
assert not runtime, f'runtime dependencies appeared: {runtime}'
|
|
52
|
+
import opendartclient
|
|
53
|
+
print('opendartclient', opendartclient.__version__, 'imports with no third-party packages')
|
|
54
|
+
"
|
|
55
|
+
|
|
56
|
+
- name: Confirm a user's type checker can see the hints
|
|
57
|
+
# Every hint is invisible to a user unless py.typed ships in the built wheel
|
|
58
|
+
# (PEP 561), and the source cannot answer whether it did. So ask it the way a
|
|
59
|
+
# user does: install the built package into a clean env and run their checker.
|
|
60
|
+
run: |
|
|
61
|
+
uv venv /tmp/typed --python ${{ matrix.python-version }}
|
|
62
|
+
uv pip install --python /tmp/typed/bin/python . mypy
|
|
63
|
+
cat > /tmp/user_code.py <<'PY'
|
|
64
|
+
from opendartclient import OpenDart
|
|
65
|
+
|
|
66
|
+
dart = OpenDart(api_key="x")
|
|
67
|
+
# report_code is a Literal["11011","11012","11013","11014"]; "99999" is not one.
|
|
68
|
+
dart.finance.single_accounts("00126380", fiscal_year=2025, report_code="99999")
|
|
69
|
+
PY
|
|
70
|
+
/tmp/typed/bin/mypy /tmp/user_code.py > /tmp/mypy_out 2>&1 || true
|
|
71
|
+
cat /tmp/mypy_out
|
|
72
|
+
grep -q 'Literal' /tmp/mypy_out
|
|
73
|
+
grep -q 'report_code' /tmp/mypy_out
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# AI coding agents
|
|
2
|
+
CLAUDE.md
|
|
3
|
+
.claude/
|
|
4
|
+
AGENTS.md
|
|
5
|
+
AGENT.md
|
|
6
|
+
.codex/
|
|
7
|
+
GEMINI.md
|
|
8
|
+
.gemini/
|
|
9
|
+
|
|
10
|
+
dev/
|
|
11
|
+
|
|
12
|
+
# Python
|
|
13
|
+
__pycache__/
|
|
14
|
+
*.py[cod]
|
|
15
|
+
*.egg-info/
|
|
16
|
+
build/
|
|
17
|
+
dist/
|
|
18
|
+
.venv/
|
|
19
|
+
venv/
|
|
20
|
+
.pytest_cache/
|
|
21
|
+
.ruff_cache/
|
|
22
|
+
.mypy_cache/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Seokhoon Joo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: opendart-client
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A clean, sync, typed Python client for Korea's OpenDART (전자공시) disclosure API.
|
|
5
|
+
Project-URL: Homepage, https://github.com/seokhoonj/opendart-client
|
|
6
|
+
Project-URL: Repository, https://github.com/seokhoonj/opendart-client
|
|
7
|
+
Author-email: Seokhoon Joo <seokhoonj@gmail.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: dart,disclosure,finance,fss,korea,opendart,전자공시
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: mypy>=1.11; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# opendart-client
|
|
30
|
+
|
|
31
|
+
[](https://github.com/seokhoonj/opendart-client/actions/workflows/check.yml)
|
|
32
|
+
[](https://pypi.org/project/opendart-client/)
|
|
33
|
+
[](https://pypi.org/project/opendart-client/)
|
|
34
|
+
[](https://github.com/seokhoonj/opendart-client/blob/main/LICENSE)
|
|
35
|
+
|
|
36
|
+
**English** | [한국어](https://github.com/seokhoonj/opendart-client/blob/main/README.ko.md)
|
|
37
|
+
|
|
38
|
+
A clean, typed Python client for Korea's **OpenDART** (전자공시) — the Financial
|
|
39
|
+
Supervisory Service's electronic disclosure system.
|
|
40
|
+
|
|
41
|
+
Zero dependencies. Sync. Returns plain `dict` / `list[dict]`, so you frame it your way.
|
|
42
|
+
|
|
43
|
+
## Install
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install opendart-client
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Get a free API key (40 chars) at <https://opendart.fss.or.kr>.
|
|
50
|
+
|
|
51
|
+
## Quickstart
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from opendartclient import OpenDart
|
|
55
|
+
|
|
56
|
+
dart = OpenDart(api_key="...") # or set OPENDART_API_KEY in the environment
|
|
57
|
+
|
|
58
|
+
# resolve a name / ticker / 초성 / typo -> corp_code
|
|
59
|
+
code = dart.resolver().resolve("삼성전자") # "00126380"
|
|
60
|
+
|
|
61
|
+
# disclosures filed in a date window
|
|
62
|
+
rows = dart.disclosure.search(
|
|
63
|
+
corp_code=code, begin_date="20260101", end_date="20260131",
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
# financial statements, and any corporate event
|
|
67
|
+
dart.finance.single_accounts(code, fiscal_year=2025)
|
|
68
|
+
dart.event.paid_in_capital_increase(
|
|
69
|
+
corp_code=code, begin_date="20260101", end_date="20260131",
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
# want a DataFrame? returns are list[dict], which the constructors take directly
|
|
73
|
+
import pandas as pd
|
|
74
|
+
pd.DataFrame(rows)
|
|
75
|
+
# or
|
|
76
|
+
import polars as pl
|
|
77
|
+
pl.DataFrame(rows)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Features
|
|
81
|
+
|
|
82
|
+
- **All 85 OpenDART endpoints** across six groups — disclosure, periodic reports,
|
|
83
|
+
financial statements, ownership, major-event reports, securities registration —
|
|
84
|
+
as readable methods (`dart.event.convertible_bond(...)`, not `cvbdIsDecsn`).
|
|
85
|
+
- **Company resolver** — name / ticker / 초성 (`ㅅㅅㅈㅈ`) / typo → `corp_code`.
|
|
86
|
+
- **Zero runtime dependencies** — the standard library carries it all. Rows come back
|
|
87
|
+
as `list[dict]`, which `pandas.DataFrame` / `polars.DataFrame` accept directly, so
|
|
88
|
+
no DataFrame adapter is needed.
|
|
89
|
+
- **Fully typed**, ships `py.typed`; closed vocabularies are `Literal`s, so a bad code
|
|
90
|
+
fails the type checker, not the API.
|
|
91
|
+
- **Raw returns** — `list[dict]` (flat), `dict[str, list[dict]]` (grouped), `bytes`
|
|
92
|
+
(zip endpoints). `status 013` (no data) is an empty result; other errors raise a
|
|
93
|
+
typed `DartError`.
|
|
94
|
+
|
|
95
|
+
## API
|
|
96
|
+
|
|
97
|
+
Top level: `dart.corp_codes()` (all corp_code ↔ name / ticker), `dart.resolver()` →
|
|
98
|
+
`CorpResolver.resolve(query)` / `.search(query)`.
|
|
99
|
+
|
|
100
|
+
`report_code` defaults to `"11011"` (annual report). Others: `11012` half-year,
|
|
101
|
+
`11013` Q1, `11014` Q3.
|
|
102
|
+
|
|
103
|
+
### disclosure
|
|
104
|
+
|
|
105
|
+
| Method | Description |
|
|
106
|
+
|---|---|
|
|
107
|
+
| `search(corp_code=…, begin_date=…, end_date=…, …)` | Filings matching the window / filters (auto-paginated) |
|
|
108
|
+
| `company(corp_code)` | Company profile (name, ceo, address, industry, …) |
|
|
109
|
+
| `document(rcept_no)` | Original filing as raw zip `bytes` |
|
|
110
|
+
|
|
111
|
+
### report (periodic-report key items)
|
|
112
|
+
|
|
113
|
+
All take `(corp_code, *, fiscal_year, report_code="11011")`.
|
|
114
|
+
|
|
115
|
+
| Method | Description |
|
|
116
|
+
|---|---|
|
|
117
|
+
| `total_shares` | Total number of shares |
|
|
118
|
+
| `treasury_shares` | Treasury stock acquired and disposed |
|
|
119
|
+
| `dividends` | Dividends |
|
|
120
|
+
| `capital_changes` | Capital increase / reduction history |
|
|
121
|
+
| `debt_securities_issued` | Debt securities issuance record |
|
|
122
|
+
| `commercial_paper_outstanding` | Commercial paper outstanding balance |
|
|
123
|
+
| `short_term_bond_outstanding` | Short-term bond outstanding balance |
|
|
124
|
+
| `corporate_bond_outstanding` | Corporate bond outstanding balance |
|
|
125
|
+
| `hybrid_security_outstanding` | Hybrid capital security outstanding balance |
|
|
126
|
+
| `contingent_capital_outstanding` | Contingent capital security outstanding balance |
|
|
127
|
+
| `public_offering_fund_usage` | Use of public-offering proceeds |
|
|
128
|
+
| `private_placement_fund_usage` | Use of private-placement proceeds |
|
|
129
|
+
| `audit_opinion` | External auditor name and audit opinion |
|
|
130
|
+
| `audit_service_contracts` | Audit service contracts |
|
|
131
|
+
| `non_audit_service_contracts` | Non-audit service contracts with the auditor |
|
|
132
|
+
| `outside_directors` | Outside (independent) directors and changes |
|
|
133
|
+
| `largest_shareholders` | Largest shareholder |
|
|
134
|
+
| `largest_shareholder_changes` | Largest shareholder changes |
|
|
135
|
+
| `minority_shareholders` | Minority shareholders |
|
|
136
|
+
| `executives` | Officers / executives |
|
|
137
|
+
| `employees` | Employees |
|
|
138
|
+
| `unregistered_executive_pay` | Unregistered-executive compensation |
|
|
139
|
+
| `director_pay_approved` | Director & auditor pay (AGM-approved amount) |
|
|
140
|
+
| `director_pay_total` | Director & auditor pay (total paid) |
|
|
141
|
+
| `director_pay_by_type` | Director & auditor pay (by type) |
|
|
142
|
+
| `individual_pay` | Individual director/auditor pay (>= 500M KRW) |
|
|
143
|
+
| `individual_pay_v2` | Individual pay (>= 500M KRW) Ver2.0 — filings after 2026-05, grouped |
|
|
144
|
+
| `top5_individual_pay` | Top-5 individual pay (>= 500M KRW) |
|
|
145
|
+
| `top5_individual_pay_v2` | Top-5 individual pay Ver2.0 — filings after 2026-05, grouped |
|
|
146
|
+
| `equity_investments` | Investments in other corporations |
|
|
147
|
+
|
|
148
|
+
### finance
|
|
149
|
+
|
|
150
|
+
| Method | Description |
|
|
151
|
+
|---|---|
|
|
152
|
+
| `single_accounts(corp_code, *, fiscal_year, report_code)` | Key accounts, one company |
|
|
153
|
+
| `multi_accounts(corp_codes, *, fiscal_year, report_code)` | Key accounts, several companies |
|
|
154
|
+
| `full_statements(corp_code, *, fiscal_year, statement_div, report_code)` | Full statements (every BS/IS/CIS/CF line) |
|
|
155
|
+
| `single_indicators(corp_code, *, fiscal_year, index_class, report_code)` | Key financial ratios, one company |
|
|
156
|
+
| `multi_indicators(corp_codes, *, fiscal_year, index_class, report_code)` | Key financial ratios, several companies |
|
|
157
|
+
| `xbrl_document(rcept_no, *, report_code)` | Raw XBRL zip for one filing (`bytes`) |
|
|
158
|
+
| `xbrl_taxonomy(*, statement_kind)` | Standard XBRL account taxonomy |
|
|
159
|
+
|
|
160
|
+
### ownership
|
|
161
|
+
|
|
162
|
+
| Method | Description |
|
|
163
|
+
|---|---|
|
|
164
|
+
| `insider_holdings(corp_code)` | Insider (officer / major-shareholder) ownership filings |
|
|
165
|
+
| `five_percent_holdings(corp_code)` | 5%-rule large-holding filings |
|
|
166
|
+
|
|
167
|
+
### event (major-event reports)
|
|
168
|
+
|
|
169
|
+
All take `(corp_code, *, begin_date, end_date)`.
|
|
170
|
+
|
|
171
|
+
| Method | Description |
|
|
172
|
+
|---|---|
|
|
173
|
+
| `default_occurrence` | Default (부도) occurrence |
|
|
174
|
+
| `business_suspension` | Business suspension |
|
|
175
|
+
| `rehabilitation_filing` | Rehabilitation-procedure filing |
|
|
176
|
+
| `dissolution_cause` | Dissolution cause occurrence |
|
|
177
|
+
| `paid_in_capital_increase` | Paid-in capital increase decision |
|
|
178
|
+
| `bonus_issue` | Bonus issue (free capital increase) decision |
|
|
179
|
+
| `combined_capital_increase` | Combined paid-in / bonus increase decision |
|
|
180
|
+
| `capital_reduction` | Capital reduction decision |
|
|
181
|
+
| `creditor_management_start` | Creditor-bank management-procedure start |
|
|
182
|
+
| `creditor_management_stop` | Creditor-bank management-procedure stop |
|
|
183
|
+
| `litigation` | Litigation filed |
|
|
184
|
+
| `overseas_listing_decision` | Overseas listing decision |
|
|
185
|
+
| `overseas_delisting_decision` | Overseas delisting decision |
|
|
186
|
+
| `overseas_listing` | Overseas listing |
|
|
187
|
+
| `overseas_delisting` | Overseas delisting |
|
|
188
|
+
| `convertible_bond` | Convertible bond (CB) issuance decision |
|
|
189
|
+
| `bond_with_warrant` | Bond with warrant (BW) issuance decision |
|
|
190
|
+
| `exchangeable_bond` | Exchangeable bond (EB) issuance decision |
|
|
191
|
+
| `contingent_convertible_bond` | Write-down contingent capital security issuance decision |
|
|
192
|
+
| `treasury_acquisition` | Treasury stock acquisition decision |
|
|
193
|
+
| `treasury_disposal` | Treasury stock disposal decision |
|
|
194
|
+
| `treasury_trust_contract` | Treasury-stock trust-contract decision |
|
|
195
|
+
| `treasury_trust_termination` | Treasury-stock trust-termination decision |
|
|
196
|
+
| `asset_transaction` | Asset transfer (other) / put-back option |
|
|
197
|
+
| `business_acquisition` | Business acquisition decision |
|
|
198
|
+
| `business_transfer` | Business transfer decision |
|
|
199
|
+
| `tangible_asset_acquisition` | Tangible asset acquisition decision |
|
|
200
|
+
| `tangible_asset_transfer` | Tangible asset transfer decision |
|
|
201
|
+
| `equity_stake_acquisition` | Acquisition of another company's shares / equity |
|
|
202
|
+
| `equity_stake_transfer` | Transfer of another company's shares / equity |
|
|
203
|
+
| `equity_bond_acquisition` | Acquisition of share-related bonds |
|
|
204
|
+
| `equity_bond_transfer` | Transfer of share-related bonds |
|
|
205
|
+
| `merger` | Company merger decision |
|
|
206
|
+
| `spinoff` | Company split (spin-off) decision |
|
|
207
|
+
| `split_merger` | Split-merger decision |
|
|
208
|
+
| `stock_exchange` | Stock exchange / transfer decision |
|
|
209
|
+
|
|
210
|
+
### registration (securities-registration statements)
|
|
211
|
+
|
|
212
|
+
All take `(corp_code, *, begin_date, end_date)`.
|
|
213
|
+
|
|
214
|
+
| Method | Description |
|
|
215
|
+
|---|---|
|
|
216
|
+
| `equity_securities` | Equity securities |
|
|
217
|
+
| `debt_securities` | Debt securities |
|
|
218
|
+
| `depositary_receipts` | Depositary receipts |
|
|
219
|
+
| `merger` | Merger |
|
|
220
|
+
| `stock_exchange` | Comprehensive stock exchange / transfer |
|
|
221
|
+
| `division` | Division |
|
|
222
|
+
|
|
223
|
+
## License
|
|
224
|
+
|
|
225
|
+
MIT © Seokhoon Joo
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# opendart-client
|
|
2
|
+
|
|
3
|
+
[](https://github.com/seokhoonj/opendart-client/actions/workflows/check.yml)
|
|
4
|
+
[](https://pypi.org/project/opendart-client/)
|
|
5
|
+
[](https://pypi.org/project/opendart-client/)
|
|
6
|
+
[](https://github.com/seokhoonj/opendart-client/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
[English](https://github.com/seokhoonj/opendart-client/blob/main/README.md) | **한국어**
|
|
9
|
+
|
|
10
|
+
한국 **OpenDART**(금융감독원 전자공시시스템) API를 위한 깔끔한 타입드 파이썬 클라이언트.
|
|
11
|
+
미국 SEC EDGAR에 해당하는 그 전자공시죠.
|
|
12
|
+
|
|
13
|
+
의존성 0개, 동기(sync), `dict` / `list[dict]` 그대로 반환 — DataFrame은 원하는 대로.
|
|
14
|
+
|
|
15
|
+
## 설치
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install opendart-client
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
무료 API 키(40자리)는 <https://opendart.fss.or.kr> 에서 발급.
|
|
22
|
+
|
|
23
|
+
## 빠른 시작
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from opendartclient import OpenDart
|
|
27
|
+
|
|
28
|
+
dart = OpenDart(api_key="...") # 또는 환경변수 OPENDART_API_KEY
|
|
29
|
+
|
|
30
|
+
# 이름 / 티커 / 초성 / 오타 -> corp_code
|
|
31
|
+
code = dart.resolver().resolve("삼성전자") # "00126380"
|
|
32
|
+
|
|
33
|
+
# 기간 내 공시 목록
|
|
34
|
+
rows = dart.disclosure.search(
|
|
35
|
+
corp_code=code, begin_date="20260101", end_date="20260131",
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
# 재무제표, 그리고 모든 주요사항(이벤트)
|
|
39
|
+
dart.finance.single_accounts(code, fiscal_year=2025)
|
|
40
|
+
dart.event.paid_in_capital_increase(
|
|
41
|
+
corp_code=code, begin_date="20260101", end_date="20260131",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
# DataFrame이 필요하면 — 반환이 list[dict]이라 생성자에 그대로 넣으면 됩니다
|
|
45
|
+
import pandas as pd
|
|
46
|
+
pd.DataFrame(rows)
|
|
47
|
+
# 또는
|
|
48
|
+
import polars as pl
|
|
49
|
+
pl.DataFrame(rows)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 특징
|
|
53
|
+
|
|
54
|
+
- **OpenDART 85개 엔드포인트 전부** — 공시정보 · 정기보고서 · 재무정보 · 지분공시 ·
|
|
55
|
+
주요사항보고서 · 증권신고서 6그룹을, **읽히는 메서드명**으로
|
|
56
|
+
(`dart.event.convertible_bond(...)`, `cvbdIsDecsn` 아님).
|
|
57
|
+
- **회사 리졸버** — 이름 / 티커 / 초성(`ㅅㅅㅈㅈ`) / 오타 → `corp_code`.
|
|
58
|
+
- **런타임 의존성 0개** — 표준 라이브러리만. 반환이 `list[dict]`이라 `pandas.DataFrame` ·
|
|
59
|
+
`polars.DataFrame` 생성자에 바로 넣으면 됩니다(어댑터 불필요).
|
|
60
|
+
- **완전 타입드**, `py.typed` 동봉. 닫힌 어휘는 `Literal`이라 잘못된 코드는 API가
|
|
61
|
+
아니라 타입체커가 잡음.
|
|
62
|
+
- **raw 반환** — `list[dict]`(flat) · `dict[str, list[dict]]`(grouped) · `bytes`(zip
|
|
63
|
+
엔드포인트). `status 013`(데이터 없음)은 빈 결과, 그 외 에러는 타입드 `DartError`.
|
|
64
|
+
|
|
65
|
+
## API
|
|
66
|
+
|
|
67
|
+
최상위: `dart.corp_codes()` (전체 corp_code↔이름/티커), `dart.resolver()` →
|
|
68
|
+
`CorpResolver.resolve(query)` / `.search(query)`.
|
|
69
|
+
|
|
70
|
+
`report_code` 기본값 `"11011"`(사업보고서). 다른 값: `11012` 반기, `11013` 1분기,
|
|
71
|
+
`11014` 3분기.
|
|
72
|
+
|
|
73
|
+
### disclosure — 공시정보
|
|
74
|
+
|
|
75
|
+
| 메서드 | 설명 |
|
|
76
|
+
|---|---|
|
|
77
|
+
| `search(corp_code=…, begin_date=…, end_date=…, …)` | 공시검색: 기간·필터에 맞는 모든 공시 (자동 페이지네이션) |
|
|
78
|
+
| `company(corp_code)` | 기업개황 (상호·대표·주소·업종 등) |
|
|
79
|
+
| `document(rcept_no)` | 공시서류 원본파일 (zip `bytes`) |
|
|
80
|
+
|
|
81
|
+
### report — 정기보고서 주요정보
|
|
82
|
+
|
|
83
|
+
모두 `(corp_code, *, fiscal_year, report_code="11011")`.
|
|
84
|
+
|
|
85
|
+
| 메서드 | 설명 |
|
|
86
|
+
|---|---|
|
|
87
|
+
| `total_shares` | 주식의 총수 현황 |
|
|
88
|
+
| `treasury_shares` | 자기주식 취득 및 처분 현황 |
|
|
89
|
+
| `dividends` | 배당에 관한 사항 |
|
|
90
|
+
| `capital_changes` | 증자(감자) 현황 |
|
|
91
|
+
| `debt_securities_issued` | 채무증권 발행실적 |
|
|
92
|
+
| `commercial_paper_outstanding` | 기업어음증권 미상환 잔액 |
|
|
93
|
+
| `short_term_bond_outstanding` | 단기사채 미상환 잔액 |
|
|
94
|
+
| `corporate_bond_outstanding` | 회사채 미상환 잔액 |
|
|
95
|
+
| `hybrid_security_outstanding` | 신종자본증권 미상환 잔액 |
|
|
96
|
+
| `contingent_capital_outstanding` | 조건부 자본증권 미상환 잔액 |
|
|
97
|
+
| `public_offering_fund_usage` | 공모자금의 사용내역 |
|
|
98
|
+
| `private_placement_fund_usage` | 사모자금의 사용내역 |
|
|
99
|
+
| `audit_opinion` | 회계감사인의 명칭 및 감사의견 |
|
|
100
|
+
| `audit_service_contracts` | 감사용역체결현황 |
|
|
101
|
+
| `non_audit_service_contracts` | 회계감사인과의 비감사용역 계약체결 현황 |
|
|
102
|
+
| `outside_directors` | 독립(사외)이사 및 그 변동현황 |
|
|
103
|
+
| `largest_shareholders` | 최대주주 현황 |
|
|
104
|
+
| `largest_shareholder_changes` | 최대주주 변동현황 |
|
|
105
|
+
| `minority_shareholders` | 소액주주 현황 |
|
|
106
|
+
| `executives` | 임원 현황 |
|
|
107
|
+
| `employees` | 직원 현황 |
|
|
108
|
+
| `unregistered_executive_pay` | 미등기임원 보수현황 |
|
|
109
|
+
| `director_pay_approved` | 이사·감사 전체의 보수현황(주주총회 승인금액) |
|
|
110
|
+
| `director_pay_total` | 이사·감사 전체의 보수현황(보수지급금액 - 전체) |
|
|
111
|
+
| `director_pay_by_type` | 이사·감사 전체의 보수현황(유형별) |
|
|
112
|
+
| `individual_pay` | 이사·감사의 개인별 보수현황(5억원 이상) |
|
|
113
|
+
| `individual_pay_v2` | 개인별 보수현황(5억원 이상) Ver2.0 — 2026-05 이후 제출분, grouped |
|
|
114
|
+
| `top5_individual_pay` | 개인별 보수지급 금액(5억이상 상위5인) |
|
|
115
|
+
| `top5_individual_pay_v2` | 개인별 보수지급(상위5인) Ver2.0 — 2026-05 이후 제출분, grouped |
|
|
116
|
+
| `equity_investments` | 타법인 출자현황 |
|
|
117
|
+
|
|
118
|
+
### finance — 재무정보
|
|
119
|
+
|
|
120
|
+
| 메서드 | 설명 |
|
|
121
|
+
|---|---|
|
|
122
|
+
| `single_accounts(corp_code, *, fiscal_year, report_code)` | 단일회사 주요계정 |
|
|
123
|
+
| `multi_accounts(corp_codes, *, fiscal_year, report_code)` | 다중회사 주요계정 (여러 회사 동시) |
|
|
124
|
+
| `full_statements(corp_code, *, fiscal_year, statement_div, report_code)` | 단일회사 전체 재무제표 (BS/IS/CIS/CF 전 항목) |
|
|
125
|
+
| `single_indicators(corp_code, *, fiscal_year, index_class, report_code)` | 단일회사 주요 재무지표 |
|
|
126
|
+
| `multi_indicators(corp_codes, *, fiscal_year, index_class, report_code)` | 다중회사 주요 재무지표 |
|
|
127
|
+
| `xbrl_document(rcept_no, *, report_code)` | 재무제표 원본파일(XBRL) — zip `bytes` |
|
|
128
|
+
| `xbrl_taxonomy(*, statement_kind)` | XBRL 택사노미 재무제표 양식 |
|
|
129
|
+
|
|
130
|
+
### ownership — 지분공시
|
|
131
|
+
|
|
132
|
+
| 메서드 | 설명 |
|
|
133
|
+
|---|---|
|
|
134
|
+
| `insider_holdings(corp_code)` | 임원·주요주주 소유보고 |
|
|
135
|
+
| `five_percent_holdings(corp_code)` | 대량보유 상황보고 (5%룰) |
|
|
136
|
+
|
|
137
|
+
### event — 주요사항보고서
|
|
138
|
+
|
|
139
|
+
모두 `(corp_code, *, begin_date, end_date)`.
|
|
140
|
+
|
|
141
|
+
| 메서드 | 설명 |
|
|
142
|
+
|---|---|
|
|
143
|
+
| `default_occurrence` | 부도발생 |
|
|
144
|
+
| `business_suspension` | 영업정지 |
|
|
145
|
+
| `rehabilitation_filing` | 회생절차 개시신청 |
|
|
146
|
+
| `dissolution_cause` | 해산사유 발생 |
|
|
147
|
+
| `paid_in_capital_increase` | 유상증자 결정 |
|
|
148
|
+
| `bonus_issue` | 무상증자 결정 |
|
|
149
|
+
| `combined_capital_increase` | 유무상증자 결정 |
|
|
150
|
+
| `capital_reduction` | 감자 결정 |
|
|
151
|
+
| `creditor_management_start` | 채권은행 등의 관리절차 개시 |
|
|
152
|
+
| `creditor_management_stop` | 채권은행 등의 관리절차 중단 |
|
|
153
|
+
| `litigation` | 소송 등의 제기 |
|
|
154
|
+
| `overseas_listing_decision` | 해외 증권시장 주권등 상장 결정 |
|
|
155
|
+
| `overseas_delisting_decision` | 해외 증권시장 주권등 상장폐지 결정 |
|
|
156
|
+
| `overseas_listing` | 해외 증권시장 주권등 상장 |
|
|
157
|
+
| `overseas_delisting` | 해외 증권시장 주권등 상장폐지 |
|
|
158
|
+
| `convertible_bond` | 전환사채권(CB) 발행결정 |
|
|
159
|
+
| `bond_with_warrant` | 신주인수권부사채권(BW) 발행결정 |
|
|
160
|
+
| `exchangeable_bond` | 교환사채권(EB) 발행결정 |
|
|
161
|
+
| `contingent_convertible_bond` | 상각형 조건부자본증권 발행결정 |
|
|
162
|
+
| `treasury_acquisition` | 자기주식 취득 결정 |
|
|
163
|
+
| `treasury_disposal` | 자기주식 처분 결정 |
|
|
164
|
+
| `treasury_trust_contract` | 자기주식취득 신탁계약 체결 결정 |
|
|
165
|
+
| `treasury_trust_termination` | 자기주식취득 신탁계약 해지 결정 |
|
|
166
|
+
| `asset_transaction` | 자산양수도(기타), 풋백옵션 |
|
|
167
|
+
| `business_acquisition` | 영업양수 결정 |
|
|
168
|
+
| `business_transfer` | 영업양도 결정 |
|
|
169
|
+
| `tangible_asset_acquisition` | 유형자산 양수 결정 |
|
|
170
|
+
| `tangible_asset_transfer` | 유형자산 양도 결정 |
|
|
171
|
+
| `equity_stake_acquisition` | 타법인 주식 및 출자증권 양수결정 |
|
|
172
|
+
| `equity_stake_transfer` | 타법인 주식 및 출자증권 양도결정 |
|
|
173
|
+
| `equity_bond_acquisition` | 주권 관련 사채권 양수 결정 |
|
|
174
|
+
| `equity_bond_transfer` | 주권 관련 사채권 양도 결정 |
|
|
175
|
+
| `merger` | 회사합병 결정 |
|
|
176
|
+
| `spinoff` | 회사분할 결정 |
|
|
177
|
+
| `split_merger` | 회사분할합병 결정 |
|
|
178
|
+
| `stock_exchange` | 주식교환·이전 결정 |
|
|
179
|
+
|
|
180
|
+
### registration — 증권신고서
|
|
181
|
+
|
|
182
|
+
모두 `(corp_code, *, begin_date, end_date)`.
|
|
183
|
+
|
|
184
|
+
| 메서드 | 설명 |
|
|
185
|
+
|---|---|
|
|
186
|
+
| `equity_securities` | 지분증권 |
|
|
187
|
+
| `debt_securities` | 채무증권 |
|
|
188
|
+
| `depositary_receipts` | 증권예탁증권 |
|
|
189
|
+
| `merger` | 합병 |
|
|
190
|
+
| `stock_exchange` | 주식의 포괄적 교환·이전 |
|
|
191
|
+
| `division` | 분할 |
|
|
192
|
+
|
|
193
|
+
## 라이선스
|
|
194
|
+
|
|
195
|
+
MIT © Seokhoon Joo
|