datasinking 0.2.0__tar.gz → 0.2.2__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.
- {datasinking-0.2.0 → datasinking-0.2.2}/PKG-INFO +18 -1
- {datasinking-0.2.0 → datasinking-0.2.2}/README.md +17 -0
- {datasinking-0.2.0 → datasinking-0.2.2}/datasinking/client.py +11 -0
- {datasinking-0.2.0 → datasinking-0.2.2}/datasinking/mcp_server.py +32 -17
- {datasinking-0.2.0 → datasinking-0.2.2}/datasinking.egg-info/PKG-INFO +18 -1
- {datasinking-0.2.0 → datasinking-0.2.2}/pyproject.toml +1 -1
- {datasinking-0.2.0 → datasinking-0.2.2}/LICENSE +0 -0
- {datasinking-0.2.0 → datasinking-0.2.2}/datasinking/__init__.py +0 -0
- {datasinking-0.2.0 → datasinking-0.2.2}/datasinking.egg-info/SOURCES.txt +0 -0
- {datasinking-0.2.0 → datasinking-0.2.2}/datasinking.egg-info/dependency_links.txt +0 -0
- {datasinking-0.2.0 → datasinking-0.2.2}/datasinking.egg-info/entry_points.txt +0 -0
- {datasinking-0.2.0 → datasinking-0.2.2}/datasinking.egg-info/requires.txt +0 -0
- {datasinking-0.2.0 → datasinking-0.2.2}/datasinking.egg-info/top_level.txt +0 -0
- {datasinking-0.2.0 → datasinking-0.2.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datasinking
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Python client for DataSinking — full-text Asian financial reports (China, Korea, Japan) as Markdown.
|
|
5
5
|
Author: DataSinking
|
|
6
6
|
License: MIT
|
|
@@ -22,7 +22,10 @@ Dynamic: license-file
|
|
|
22
22
|
|
|
23
23
|
# DataSinking
|
|
24
24
|
|
|
25
|
+
<!-- mcp-name: io.github.heubme2020/datasinking -->
|
|
26
|
+
|
|
25
27
|
[](https://pypi.org/project/datasinking/)
|
|
28
|
+
[](https://github.com/heubme2020/datasinking#mcp-server)
|
|
26
29
|
|
|
27
30
|
**Full-text financial reports across Asia, as clean Markdown.**
|
|
28
31
|
|
|
@@ -35,6 +38,20 @@ YAML frontmatter, preserved headings, paragraphs and tables.
|
|
|
35
38
|
|
|
36
39
|
---
|
|
37
40
|
|
|
41
|
+
## MCP server
|
|
42
|
+
|
|
43
|
+
Ship DataSinking to any AI agent (Claude Desktop / Cursor / Codex / Windsurf) as an
|
|
44
|
+
[MCP](https://modelcontextprotocol.io) server — 6 tools: list exchanges, list stocks,
|
|
45
|
+
list reports, fetch a report, list sections, fetch one section (token-friendly for RAG).
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install "datasinking[mcp]"
|
|
49
|
+
datasinking-mcp # requires DATASINK_API_KEY (free at https://datasink.ing)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or add to your client with `command: datasinking-mcp`. A remote streamable-HTTP endpoint
|
|
53
|
+
is also live at `https://api.datasink.ing/mcp`. See [`mcp-server.md`](mcp-server.md).
|
|
54
|
+
|
|
38
55
|
## What this repo is
|
|
39
56
|
|
|
40
57
|
Examples, research and tutorials showing how to work with financial report data, including reproducing the presentation styles found in financial-report research papers.
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# DataSinking
|
|
2
2
|
|
|
3
|
+
<!-- mcp-name: io.github.heubme2020/datasinking -->
|
|
4
|
+
|
|
3
5
|
[](https://pypi.org/project/datasinking/)
|
|
6
|
+
[](https://github.com/heubme2020/datasinking#mcp-server)
|
|
4
7
|
|
|
5
8
|
**Full-text financial reports across Asia, as clean Markdown.**
|
|
6
9
|
|
|
@@ -13,6 +16,20 @@ YAML frontmatter, preserved headings, paragraphs and tables.
|
|
|
13
16
|
|
|
14
17
|
---
|
|
15
18
|
|
|
19
|
+
## MCP server
|
|
20
|
+
|
|
21
|
+
Ship DataSinking to any AI agent (Claude Desktop / Cursor / Codex / Windsurf) as an
|
|
22
|
+
[MCP](https://modelcontextprotocol.io) server — 6 tools: list exchanges, list stocks,
|
|
23
|
+
list reports, fetch a report, list sections, fetch one section (token-friendly for RAG).
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install "datasinking[mcp]"
|
|
27
|
+
datasinking-mcp # requires DATASINK_API_KEY (free at https://datasink.ing)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or add to your client with `command: datasinking-mcp`. A remote streamable-HTTP endpoint
|
|
31
|
+
is also live at `https://api.datasink.ing/mcp`. See [`mcp-server.md`](mcp-server.md).
|
|
32
|
+
|
|
16
33
|
## What this repo is
|
|
17
34
|
|
|
18
35
|
Examples, research and tutorials showing how to work with financial report data, including reproducing the presentation styles found in financial-report research papers.
|
|
@@ -130,3 +130,14 @@ class DataSinking:
|
|
|
130
130
|
d = self._get("/documents", dict(params, size=limit, order="desc"))
|
|
131
131
|
ids = [it["id"] for it in d["items"]]
|
|
132
132
|
return self._batch_content(ids)
|
|
133
|
+
|
|
134
|
+
def list_sections(self, doc_id):
|
|
135
|
+
"""列出报告的章节标题 -> list[str](供 get_section 用)"""
|
|
136
|
+
return self._get(f"/documents/{doc_id}/sections")["sections"]
|
|
137
|
+
|
|
138
|
+
def get_section(self, doc_id, section):
|
|
139
|
+
"""只取报告的某一章(省 token,适合 RAG)-> dict,含 content 和 section
|
|
140
|
+
|
|
141
|
+
section: 章节标题关键词,如 "管理层讨论与分析" / "财务报告" / "MD&A"
|
|
142
|
+
"""
|
|
143
|
+
return self._get(f"/documents/{doc_id}", {"section": section})
|
|
@@ -34,10 +34,15 @@ API_KEY = os.environ.get("DATASINK_API_KEY", "")
|
|
|
34
34
|
|
|
35
35
|
mcp = FastMCP(
|
|
36
36
|
"DataSinking",
|
|
37
|
+
title="DataSinking — Full-text Asian Financial Reports",
|
|
38
|
+
description="Full-text Asian financial reports (China, Korea, Japan) as clean Markdown via API, with chapter-level access for RAG and AI agents.",
|
|
39
|
+
version="0.2.2",
|
|
37
40
|
instructions=(
|
|
38
|
-
"DataSinking
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
+
"DataSinking serves full-text financial reports (annual / semi-annual / quarterly) "
|
|
42
|
+
"from China, Korea and Japan as clean Markdown, ready for LLM reading and RAG. "
|
|
43
|
+
"Use FMP-style symbols: 600519.SS (Kweichow Moutai), 005930.KS (Samsung Electronics), "
|
|
44
|
+
"7203.T (Toyota). To save tokens, prefer get_section to pull one chapter (e.g. MD&A) "
|
|
45
|
+
"instead of get_report for the whole document."
|
|
41
46
|
),
|
|
42
47
|
)
|
|
43
48
|
|
|
@@ -45,7 +50,9 @@ mcp = FastMCP(
|
|
|
45
50
|
def _get(path: str, params: Optional[dict] = None) -> dict:
|
|
46
51
|
"""Call the DataSinking API, carrying the API key automatically."""
|
|
47
52
|
if not API_KEY:
|
|
48
|
-
raise RuntimeError(
|
|
53
|
+
raise RuntimeError(
|
|
54
|
+
"Missing DATASINK_API_KEY environment variable (get a free key at https://datasink.ing)"
|
|
55
|
+
)
|
|
49
56
|
p = dict(params or {})
|
|
50
57
|
p["apikey"] = API_KEY
|
|
51
58
|
r = requests.get(f"{BASE_URL}{path}", params=p, timeout=90)
|
|
@@ -55,17 +62,21 @@ def _get(path: str, params: Optional[dict] = None) -> dict:
|
|
|
55
62
|
|
|
56
63
|
@mcp.tool()
|
|
57
64
|
def list_exchanges() -> list:
|
|
58
|
-
"""
|
|
65
|
+
"""List the exchanges DataSinking covers and their report counts.
|
|
66
|
+
|
|
67
|
+
Returns exchange codes (sse / szse / bj / ksc / koe / knx / jpx) with the number
|
|
68
|
+
of reports available per exchange. Call this first to discover coverage.
|
|
69
|
+
"""
|
|
59
70
|
return _get("/exchanges").get("exchanges", [])
|
|
60
71
|
|
|
61
72
|
|
|
62
73
|
@mcp.tool()
|
|
63
74
|
def list_stocks(exchange: str, limit: int = 20) -> dict:
|
|
64
|
-
"""
|
|
75
|
+
"""List stocks on an exchange, including the report count per company.
|
|
65
76
|
|
|
66
77
|
Args:
|
|
67
|
-
exchange:
|
|
68
|
-
limit:
|
|
78
|
+
exchange: Exchange code, e.g. sse / szse / bj / ksc / koe / knx / jpx
|
|
79
|
+
limit: Return the first N companies (default 20) to keep responses short.
|
|
69
80
|
"""
|
|
70
81
|
data = _get("/stocks", {"exchange": exchange})
|
|
71
82
|
return {"exchange": exchange, "total": data.get("total", 0), "items": data.get("items", [])[:limit]}
|
|
@@ -73,39 +84,43 @@ def list_stocks(exchange: str, limit: int = 20) -> dict:
|
|
|
73
84
|
|
|
74
85
|
@mcp.tool()
|
|
75
86
|
def list_reports(symbol: str, doc_type: str = "annual", size: int = 10) -> dict:
|
|
76
|
-
"""
|
|
87
|
+
"""List a company's reports — metadata only (id, title, period), no body text.
|
|
77
88
|
|
|
78
89
|
Args:
|
|
79
|
-
symbol: FMP
|
|
90
|
+
symbol: FMP-style symbol, e.g. 600519.SS / 005930.KS / 7203.T
|
|
80
91
|
doc_type: annual / semiannual / q1 / q3
|
|
81
|
-
size:
|
|
92
|
+
size: Number of reports to return (default 10).
|
|
82
93
|
"""
|
|
83
94
|
return _get("/documents", {"symbol": symbol, "doc_type": doc_type, "size": size})
|
|
84
95
|
|
|
85
96
|
|
|
86
97
|
@mcp.tool()
|
|
87
98
|
def get_report(document_id: int) -> dict:
|
|
88
|
-
"""
|
|
99
|
+
"""Fetch a single report's full text (metadata + Markdown body).
|
|
89
100
|
|
|
90
101
|
Args:
|
|
91
|
-
document_id:
|
|
102
|
+
document_id: Report id, from list_reports items[].id
|
|
92
103
|
"""
|
|
93
104
|
return _get(f"/documents/{document_id}")
|
|
94
105
|
|
|
95
106
|
|
|
96
107
|
@mcp.tool()
|
|
97
108
|
def list_sections(document_id: int) -> dict:
|
|
98
|
-
"""
|
|
109
|
+
"""List every section heading in a report (feed the headings to get_section).
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
document_id: Report id
|
|
113
|
+
"""
|
|
99
114
|
return _get(f"/documents/{document_id}/sections")
|
|
100
115
|
|
|
101
116
|
|
|
102
117
|
@mcp.tool()
|
|
103
118
|
def get_section(document_id: int, section: str) -> dict:
|
|
104
|
-
"""
|
|
119
|
+
"""Fetch only one section of a report by keyword — cheaper than get_report for RAG.
|
|
105
120
|
|
|
106
121
|
Args:
|
|
107
|
-
document_id:
|
|
108
|
-
section:
|
|
122
|
+
document_id: Report id
|
|
123
|
+
section: Heading keyword, e.g. "management discussion" / "MD&A" / "financial statements" / "notes"
|
|
109
124
|
"""
|
|
110
125
|
return _get(f"/documents/{document_id}", {"section": section})
|
|
111
126
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datasinking
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Python client for DataSinking — full-text Asian financial reports (China, Korea, Japan) as Markdown.
|
|
5
5
|
Author: DataSinking
|
|
6
6
|
License: MIT
|
|
@@ -22,7 +22,10 @@ Dynamic: license-file
|
|
|
22
22
|
|
|
23
23
|
# DataSinking
|
|
24
24
|
|
|
25
|
+
<!-- mcp-name: io.github.heubme2020/datasinking -->
|
|
26
|
+
|
|
25
27
|
[](https://pypi.org/project/datasinking/)
|
|
28
|
+
[](https://github.com/heubme2020/datasinking#mcp-server)
|
|
26
29
|
|
|
27
30
|
**Full-text financial reports across Asia, as clean Markdown.**
|
|
28
31
|
|
|
@@ -35,6 +38,20 @@ YAML frontmatter, preserved headings, paragraphs and tables.
|
|
|
35
38
|
|
|
36
39
|
---
|
|
37
40
|
|
|
41
|
+
## MCP server
|
|
42
|
+
|
|
43
|
+
Ship DataSinking to any AI agent (Claude Desktop / Cursor / Codex / Windsurf) as an
|
|
44
|
+
[MCP](https://modelcontextprotocol.io) server — 6 tools: list exchanges, list stocks,
|
|
45
|
+
list reports, fetch a report, list sections, fetch one section (token-friendly for RAG).
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install "datasinking[mcp]"
|
|
49
|
+
datasinking-mcp # requires DATASINK_API_KEY (free at https://datasink.ing)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or add to your client with `command: datasinking-mcp`. A remote streamable-HTTP endpoint
|
|
53
|
+
is also live at `https://api.datasink.ing/mcp`. See [`mcp-server.md`](mcp-server.md).
|
|
54
|
+
|
|
38
55
|
## What this repo is
|
|
39
56
|
|
|
40
57
|
Examples, research and tutorials showing how to work with financial report data, including reproducing the presentation styles found in financial-report research papers.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "datasinking"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "Python client for DataSinking — full-text Asian financial reports (China, Korea, Japan) as Markdown."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|