edgarparser-sdk 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.
@@ -0,0 +1,10 @@
1
+ build/
2
+ dist/
3
+ *.egg-info/
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .venv/
8
+ __pycache__/
9
+ *.py[cod]
10
+ .DS_Store
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 Henry Chien
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,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: edgarparser-sdk
3
+ Version: 0.1.0
4
+ Summary: Python SDK for the hosted EdgarParser SEC filings API
5
+ Project-URL: Homepage, https://www.edgarparser.com
6
+ Project-URL: Documentation, https://docs.edgarparser.com
7
+ Project-URL: Hosted API, https://www.edgarparser.com
8
+ Project-URL: Tool Reference, https://docs.edgarparser.com/tools
9
+ Project-URL: Source, https://github.com/henrysouchien/edgarparser-python
10
+ Project-URL: Issues, https://github.com/henrysouchien/edgarparser-python/issues
11
+ License-Expression: MIT
12
+ License-File: LICENSE
13
+ Requires-Python: >=3.10
14
+ Requires-Dist: requests>=2.31.0
15
+ Provides-Extra: dev
16
+ Requires-Dist: build; extra == 'dev'
17
+ Requires-Dist: pytest; extra == 'dev'
18
+ Requires-Dist: pyyaml; extra == 'dev'
19
+ Requires-Dist: twine; extra == 'dev'
20
+ Description-Content-Type: text/markdown
21
+
22
+ # edgarparser-sdk
23
+
24
+ Python SDK for the hosted EdgarParser API.
25
+
26
+ ```bash
27
+ pip install edgarparser-sdk
28
+ ```
29
+
30
+ ```python
31
+ from edgarparser import EdgarClient
32
+
33
+ client = EdgarClient(api_key="...")
34
+ print(client)
35
+ ```
36
+
37
+ ## Status
38
+
39
+ This package is being implemented in the EdgarParser source repo and is not
40
+ published yet. The current local package exports `EdgarClient`, typed SDK
41
+ errors, and the first v1 hosted-API endpoint methods.
42
+
43
+ ## Package Boundary
44
+
45
+ Install `edgarparser-sdk` and import `edgarparser` when you want the hosted
46
+ EdgarParser API from Python.
47
+
48
+ Use `edgar-parser` when you want the local parsing library.
49
+
50
+ Use `edgar-mcp` when you want AI-agent tools over the hosted API.
51
+
52
+ The SDK is intentionally a thin HTTP client. It should not parse filings
53
+ locally, rank metric matches, resolve tag equivalence, or mutate server caches
54
+ as a hidden side effect.
55
+
56
+ ## Configuration
57
+
58
+ `EdgarClient` accepts an explicit API key:
59
+
60
+ ```python
61
+ from edgarparser import EdgarClient
62
+
63
+ client = EdgarClient(api_key="edgar_...")
64
+ ```
65
+
66
+ It can also read `EDGAR_API_KEY`:
67
+
68
+ ```python
69
+ from edgarparser import EdgarClient
70
+
71
+ client = EdgarClient()
72
+ ```
73
+
74
+ Use `base_url` for staging or local API testing:
75
+
76
+ ```python
77
+ client = EdgarClient(api_key="edgar_...", base_url="http://127.0.0.1:8000")
78
+ ```
79
+
80
+ ## V1 Methods
81
+
82
+ The current local SDK surface includes:
83
+
84
+ - `get_financials`
85
+ - `get_metric`
86
+ - `get_metric_series`
87
+ - `list_metrics`
88
+ - `search_metrics`
89
+ - `get_statement`
90
+ - `get_filings`
91
+ - `get_filing_document`
92
+ - `search_filing_text`
93
+ - `warm_metric_cache`
94
+ - `warm_metric_cache_status`
95
+
96
+ ## Examples
97
+
98
+ From `packages/edgarparser/` or the synced package repo, run examples with
99
+ `EDGAR_API_KEY` set:
100
+
101
+ ```bash
102
+ EDGAR_API_KEY=... python examples/financials.py
103
+ EDGAR_API_KEY=... python examples/metric_series.py
104
+ EDGAR_API_KEY=... python examples/filing_search.py
105
+ ```
106
+
107
+ ## Development
108
+
109
+ From the repo root:
110
+
111
+ ```bash
112
+ python -m pip install -e packages/edgarparser
113
+ python -m pytest packages/edgarparser/tests -q
114
+ ```
@@ -0,0 +1,93 @@
1
+ # edgarparser-sdk
2
+
3
+ Python SDK for the hosted EdgarParser API.
4
+
5
+ ```bash
6
+ pip install edgarparser-sdk
7
+ ```
8
+
9
+ ```python
10
+ from edgarparser import EdgarClient
11
+
12
+ client = EdgarClient(api_key="...")
13
+ print(client)
14
+ ```
15
+
16
+ ## Status
17
+
18
+ This package is being implemented in the EdgarParser source repo and is not
19
+ published yet. The current local package exports `EdgarClient`, typed SDK
20
+ errors, and the first v1 hosted-API endpoint methods.
21
+
22
+ ## Package Boundary
23
+
24
+ Install `edgarparser-sdk` and import `edgarparser` when you want the hosted
25
+ EdgarParser API from Python.
26
+
27
+ Use `edgar-parser` when you want the local parsing library.
28
+
29
+ Use `edgar-mcp` when you want AI-agent tools over the hosted API.
30
+
31
+ The SDK is intentionally a thin HTTP client. It should not parse filings
32
+ locally, rank metric matches, resolve tag equivalence, or mutate server caches
33
+ as a hidden side effect.
34
+
35
+ ## Configuration
36
+
37
+ `EdgarClient` accepts an explicit API key:
38
+
39
+ ```python
40
+ from edgarparser import EdgarClient
41
+
42
+ client = EdgarClient(api_key="edgar_...")
43
+ ```
44
+
45
+ It can also read `EDGAR_API_KEY`:
46
+
47
+ ```python
48
+ from edgarparser import EdgarClient
49
+
50
+ client = EdgarClient()
51
+ ```
52
+
53
+ Use `base_url` for staging or local API testing:
54
+
55
+ ```python
56
+ client = EdgarClient(api_key="edgar_...", base_url="http://127.0.0.1:8000")
57
+ ```
58
+
59
+ ## V1 Methods
60
+
61
+ The current local SDK surface includes:
62
+
63
+ - `get_financials`
64
+ - `get_metric`
65
+ - `get_metric_series`
66
+ - `list_metrics`
67
+ - `search_metrics`
68
+ - `get_statement`
69
+ - `get_filings`
70
+ - `get_filing_document`
71
+ - `search_filing_text`
72
+ - `warm_metric_cache`
73
+ - `warm_metric_cache_status`
74
+
75
+ ## Examples
76
+
77
+ From `packages/edgarparser/` or the synced package repo, run examples with
78
+ `EDGAR_API_KEY` set:
79
+
80
+ ```bash
81
+ EDGAR_API_KEY=... python examples/financials.py
82
+ EDGAR_API_KEY=... python examples/metric_series.py
83
+ EDGAR_API_KEY=... python examples/filing_search.py
84
+ ```
85
+
86
+ ## Development
87
+
88
+ From the repo root:
89
+
90
+ ```bash
91
+ python -m pip install -e packages/edgarparser
92
+ python -m pytest packages/edgarparser/tests -q
93
+ ```
@@ -0,0 +1,15 @@
1
+ from __future__ import annotations
2
+
3
+ from edgarparser import EdgarClient
4
+
5
+
6
+ def main() -> None:
7
+ client = EdgarClient()
8
+ payload = client.search_filing_text("AAPL", "risk", year=2025, quarter=1)
9
+ for hit in payload.get("hits", [])[:3]:
10
+ section = hit.get("section_header") or hit.get("section_key")
11
+ print(section, hit.get("snippet"))
12
+
13
+
14
+ if __name__ == "__main__":
15
+ main()
@@ -0,0 +1,14 @@
1
+ from __future__ import annotations
2
+
3
+ from edgarparser import EdgarClient
4
+
5
+
6
+ def main() -> None:
7
+ client = EdgarClient()
8
+ payload = client.get_financials("AAPL", year=2025, quarter=1)
9
+ print(payload["status"])
10
+ print(len(payload.get("facts", [])))
11
+
12
+
13
+ if __name__ == "__main__":
14
+ main()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from edgarparser import EdgarClient
4
+
5
+
6
+ def main() -> None:
7
+ client = EdgarClient()
8
+ payload = client.get_metric_series(
9
+ "AAPL",
10
+ "Revenue",
11
+ end_year=2025,
12
+ end_quarter=1,
13
+ periods=4,
14
+ date_type="Q",
15
+ )
16
+ for point in payload.get("series", []):
17
+ print(point.get("period"), point.get("value"))
18
+
19
+
20
+ if __name__ == "__main__":
21
+ main()
@@ -0,0 +1,46 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "edgarparser-sdk"
7
+ dynamic = ["version"]
8
+ description = "Python SDK for the hosted EdgarParser SEC filings API"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.10"
12
+ dependencies = [
13
+ "requests>=2.31.0",
14
+ ]
15
+
16
+ [project.urls]
17
+ Homepage = "https://www.edgarparser.com"
18
+ Documentation = "https://docs.edgarparser.com"
19
+ "Hosted API" = "https://www.edgarparser.com"
20
+ "Tool Reference" = "https://docs.edgarparser.com/tools"
21
+ Source = "https://github.com/henrysouchien/edgarparser-python"
22
+ Issues = "https://github.com/henrysouchien/edgarparser-python/issues"
23
+
24
+ [project.optional-dependencies]
25
+ dev = [
26
+ "build",
27
+ "pytest",
28
+ "PyYAML",
29
+ "twine",
30
+ ]
31
+
32
+ [tool.hatch.version]
33
+ path = "src/edgarparser/__init__.py"
34
+
35
+ [tool.hatch.build.targets.wheel]
36
+ packages = ["src/edgarparser"]
37
+
38
+ [tool.hatch.build.targets.sdist]
39
+ include = [
40
+ "src/edgarparser/",
41
+ "examples/",
42
+ "pyproject.toml",
43
+ "README.md",
44
+ "LICENSE",
45
+ "tests/",
46
+ ]
@@ -0,0 +1,30 @@
1
+ """Python SDK for the hosted EdgarParser API."""
2
+
3
+ from .client import DEFAULT_BASE_URL, DEFAULT_TIMEOUT, EdgarClient
4
+ from .errors import (
5
+ EdgarAPIError,
6
+ EdgarAuthError,
7
+ EdgarError,
8
+ EdgarNotFoundError,
9
+ EdgarRateLimitError,
10
+ EdgarTimeoutError,
11
+ EdgarTransportError,
12
+ EdgarValidationError,
13
+ )
14
+
15
+ __all__ = [
16
+ "DEFAULT_BASE_URL",
17
+ "DEFAULT_TIMEOUT",
18
+ "EdgarAPIError",
19
+ "EdgarAuthError",
20
+ "EdgarClient",
21
+ "EdgarError",
22
+ "EdgarNotFoundError",
23
+ "EdgarRateLimitError",
24
+ "EdgarTimeoutError",
25
+ "EdgarTransportError",
26
+ "EdgarValidationError",
27
+ "__version__",
28
+ ]
29
+
30
+ __version__ = "0.1.0"
@@ -0,0 +1,175 @@
1
+ """Pinned API contract metadata for SDK-covered EdgarParser endpoints."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from dataclasses import dataclass
6
+
7
+
8
+ @dataclass(frozen=True)
9
+ class SDKMethodSpec:
10
+ sdk_method: str
11
+ tool_name: str
12
+ api_method: str
13
+ api_path: str
14
+ contract_version: str
15
+ schema_fingerprint: str
16
+ required_params: tuple[str, ...] = ()
17
+ optional_params: tuple[str, ...] = ()
18
+ path_params: tuple[str, ...] = ()
19
+ body_params: tuple[str, ...] = ()
20
+
21
+
22
+ SDK_METHODS: tuple[SDKMethodSpec, ...] = (
23
+ SDKMethodSpec(
24
+ sdk_method="get_financials",
25
+ tool_name="get_financials",
26
+ api_method="GET",
27
+ api_path="/api/financials",
28
+ contract_version="1.0.0",
29
+ schema_fingerprint="sha256:8c2b5486165eb2628dfb324c558c1148a48a46453f4102f0491e16503316b1c5",
30
+ required_params=("ticker", "year", "quarter"),
31
+ optional_params=("full_year_mode", "source"),
32
+ ),
33
+ SDKMethodSpec(
34
+ sdk_method="get_metric",
35
+ tool_name="get_metric",
36
+ api_method="GET",
37
+ api_path="/api/metric",
38
+ contract_version="1.0.0",
39
+ schema_fingerprint="sha256:0350ec893a5d3a2a2510dc059711a93f6ec9665a0e068b32d8c4b2d8cb8accd8",
40
+ required_params=("ticker", "year", "quarter", "metric_name"),
41
+ optional_params=("full_year_mode", "source", "date_type", "role"),
42
+ ),
43
+ SDKMethodSpec(
44
+ sdk_method="get_metric_series",
45
+ tool_name="get_metric_series",
46
+ api_method="GET",
47
+ api_path="/api/metric/series",
48
+ contract_version="1.1.0",
49
+ schema_fingerprint="sha256:dff62ae8bf4eb8c648776ac91e02e324c83a1cccbf3beeefcb7855272970a906",
50
+ required_params=("ticker", "metric_name", "end_year", "end_quarter"),
51
+ optional_params=(
52
+ "periods",
53
+ "full_year_mode",
54
+ "source",
55
+ "date_type",
56
+ "include_equivalents",
57
+ "cached_only",
58
+ "role",
59
+ "axis_key",
60
+ ),
61
+ ),
62
+ SDKMethodSpec(
63
+ sdk_method="list_metrics",
64
+ tool_name="list_metrics",
65
+ api_method="GET",
66
+ api_path="/api/financials/list_metrics",
67
+ contract_version="1.0.0",
68
+ schema_fingerprint="sha256:07341bd265a257b8c90ee99b42ecef054e6eaa16c2f341f91ffae287bfe907d8",
69
+ required_params=("ticker", "year", "quarter"),
70
+ optional_params=(
71
+ "full_year_mode",
72
+ "source",
73
+ "date_type",
74
+ "limit",
75
+ "include_values",
76
+ ),
77
+ ),
78
+ SDKMethodSpec(
79
+ sdk_method="search_metrics",
80
+ tool_name="search_metrics",
81
+ api_method="GET",
82
+ api_path="/api/financials/search_metrics",
83
+ contract_version="1.0.0",
84
+ schema_fingerprint="sha256:381c0bf743038780d55c447b0c7103da0e22d13c33b866c73130b7265071853c",
85
+ required_params=("ticker", "year", "quarter", "query"),
86
+ optional_params=(
87
+ "full_year_mode",
88
+ "source",
89
+ "date_type",
90
+ "role",
91
+ "limit",
92
+ "include_values",
93
+ ),
94
+ ),
95
+ SDKMethodSpec(
96
+ sdk_method="get_statement",
97
+ tool_name="get_statement",
98
+ api_method="GET",
99
+ api_path="/api/statement",
100
+ contract_version="1.0.0",
101
+ schema_fingerprint="sha256:6da91e176e78fe536130ed3ea11cf9b8dfccf923cbbfc47483d7cb2108383986",
102
+ required_params=("ticker", "statement"),
103
+ optional_params=(
104
+ "year",
105
+ "quarter",
106
+ "full_year_mode",
107
+ "period_from",
108
+ "period_to",
109
+ "source",
110
+ "date_type",
111
+ ),
112
+ ),
113
+ SDKMethodSpec(
114
+ sdk_method="get_filings",
115
+ tool_name="get_filings",
116
+ api_method="GET",
117
+ api_path="/api/filings",
118
+ contract_version="1.0.0",
119
+ schema_fingerprint="sha256:ffa7e669b836cbbc181bc337cb55219e55bf9a5c75ce3d27040a8aad25f8c993",
120
+ required_params=("ticker", "year", "quarter"),
121
+ optional_params=("source",),
122
+ ),
123
+ SDKMethodSpec(
124
+ sdk_method="get_filing_document",
125
+ tool_name="get_filing_document",
126
+ api_method="GET",
127
+ api_path="/api/filing/document",
128
+ contract_version="1.0.0",
129
+ schema_fingerprint="sha256:4d559aded5c9760ccb498944a984a128254a76349348de297da30ee338ff123a",
130
+ optional_params=(
131
+ "ticker",
132
+ "year",
133
+ "quarter",
134
+ "source",
135
+ "accession",
136
+ "cik",
137
+ "form_type",
138
+ "primary_document",
139
+ "sections",
140
+ "char_start",
141
+ "char_end",
142
+ "max_chars",
143
+ ),
144
+ ),
145
+ SDKMethodSpec(
146
+ sdk_method="search_filing_text",
147
+ tool_name="search_filing_text",
148
+ api_method="GET",
149
+ api_path="/api/filing/text/search",
150
+ contract_version="1.0.0",
151
+ schema_fingerprint="sha256:be08198a156e55118e9b32a0fb41ead07906469059fb27d3010f1a1f5a9c0c8c",
152
+ required_params=("ticker", "year", "quarter", "query"),
153
+ optional_params=("source",),
154
+ ),
155
+ SDKMethodSpec(
156
+ sdk_method="warm_metric_cache",
157
+ tool_name="warm_metric_cache",
158
+ api_method="POST",
159
+ api_path="/api/warm",
160
+ contract_version="1.0.0",
161
+ schema_fingerprint="sha256:1636aba36d166ecf2901e72078fc8a6182f7174e541d9183561392781e8f8cbd",
162
+ body_params=("items",),
163
+ ),
164
+ SDKMethodSpec(
165
+ sdk_method="warm_metric_cache_status",
166
+ tool_name="warm_metric_cache_status",
167
+ api_method="GET",
168
+ api_path="/api/warm/{job_id}",
169
+ contract_version="1.0.0",
170
+ schema_fingerprint="sha256:f48e0b9a707e404c640822af06d51f3523f54538fed625a24ee06dc220cb3245",
171
+ path_params=("job_id",),
172
+ ),
173
+ )
174
+
175
+ SDK_METHODS_BY_NAME = {spec.sdk_method: spec for spec in SDK_METHODS}