datasinking 0.2.8__tar.gz → 0.2.10__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datasinking
3
- Version: 0.2.8
3
+ Version: 0.2.10
4
4
  Summary: Python client for DataSinking — full-text Asian financial reports (China, Korea, Japan, Taiwan) as Markdown.
5
5
  Author: DataSinking
6
6
  License: MIT
@@ -31,27 +31,78 @@ Dynamic: license-file
31
31
  **Full-text financial reports across Asia, as clean Markdown.**
32
32
 
33
33
  [DataSinking](https://datasink.ing) serves **full-text financial reports** — annual, semi-annual
34
- and quarterly — from **China, Korea and Japan** as clean **Markdown**, ready for LLM reading
35
- and RAG. Query by FMP-style symbol (`600519.SS`, `005930.KS`, `7203.T`) or filter by exchange,
36
- report period, or **section** — pull just the MD&A / risk section instead of the whole report.
37
- Reports are sourced from official disclosure platforms and parsed into structured Markdown with
38
- YAML frontmatter, preserved headings, paragraphs and tables.
34
+ and quarterly — from **China, Korea, Japan and Taiwan** as clean **Markdown**, ready for LLM reading
35
+ and RAG. Query by FMP-style symbol (`600519.SS`, `005930.KS`, `7203.T`, `2330.TW`) or filter by
36
+ exchange, report period, or **section** — pull just the MD&A / risk section instead of the whole
37
+ report. Reports are sourced from official disclosure platforms and parsed into structured Markdown
38
+ with YAML frontmatter, preserved headings, paragraphs and tables.
39
39
 
40
40
  ---
41
41
 
42
42
  ## MCP server
43
43
 
44
- Ship DataSinking to any AI agent (Claude Desktop / Cursor / Codex / Windsurf) as an
44
+ Ship DataSinking to any AI agent (Claude / Cursor / Codex / Windsurf) as an
45
45
  [MCP](https://modelcontextprotocol.io) server — 6 tools: list exchanges, list stocks,
46
46
  list reports, fetch a report, list sections, fetch one section (token-friendly for RAG).
47
47
 
48
+ ### Hosted — nothing to install
49
+
50
+ Point any MCP client at our endpoint and you're done. No package, no Python, no local server:
51
+
52
+ ```json
53
+ {
54
+ "mcpServers": {
55
+ "datasinking": {
56
+ "type": "http",
57
+ "url": "https://api.datasink.ing/mcp?apikey=YOUR_KEY"
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ Claude Code, in one line:
64
+
65
+ ```bash
66
+ claude mcp add --transport http datasinking https://api.datasink.ing/mcp \
67
+ --header "Authorization: Bearer YOUR_KEY"
68
+ ```
69
+
70
+ Your key rides inside the URL, so treat that config as a secret. Clients that support custom
71
+ headers can send `Authorization: Bearer YOUR_KEY` instead — Claude Code redacts headers in its
72
+ output but can't redact a URL.
73
+
74
+ ### Local — run it yourself
75
+
76
+ If you'd rather keep everything on your own machine, there are two identical builds — pick
77
+ whichever runtime you already have:
78
+
79
+ **Node 18+ (no Python needed):**
80
+
81
+ ```json
82
+ {
83
+ "mcpServers": {
84
+ "datasinking": {
85
+ "command": "npx",
86
+ "args": ["-y", "datasinking-mcp"],
87
+ "env": { "DATASINK_API_KEY": "YOUR_KEY" }
88
+ }
89
+ }
90
+ }
91
+ ```
92
+
93
+ **Python 3.8+:**
94
+
48
95
  ```bash
49
96
  pip install "datasinking[mcp]"
50
97
  datasinking-mcp # requires DATASINK_API_KEY (free at https://datasink.ing)
51
98
  ```
52
99
 
53
- Or add to your client with `command: datasinking-mcp`. A remote streamable-HTTP endpoint
54
- is also live at `https://api.datasink.ing/mcp`. See [`mcp-server.md`](mcp-server.md).
100
+ Then use `command: datasinking-mcp` in your client.
101
+
102
+ Both run the same six tools with the same schemas — `npm/` and `datasinking/mcp_server.py` are
103
+ kept in lockstep by [`check_mcp_parity.py`](check_mcp_parity.py).
104
+
105
+ Full per-client setup: [`mcp-server.md`](mcp-server.md).
55
106
 
56
107
  ![DataSinking MCP in Claude](docs/images/mcp-demo.png)
57
108
 
@@ -64,6 +115,7 @@ datasinking/
64
115
  ├── examples/ # Example scripts: pull data from the API and analyze it
65
116
  ├── research/ # Research notes / blog posts (reproducing paper-style presentation)
66
117
  ├── datasinking/ # Python client + MCP server — pip install "datasinking[mcp]"
118
+ ├── npm/ # The same MCP server on npm — npx -y datasinking-mcp (Node 18+)
67
119
  ├── mcp-server.md # How to configure the MCP server (for AI agents: Claude / Cursor / Codex / DeepSeek)
68
120
  ├── llm-examples.md # Ask an LLM — no code needed (8 end-to-end examples)
69
121
  ├── api-examples.md # 7 examples × 3 interfaces (curl / Python / LLM)
@@ -8,27 +8,78 @@
8
8
  **Full-text financial reports across Asia, as clean Markdown.**
9
9
 
10
10
  [DataSinking](https://datasink.ing) serves **full-text financial reports** — annual, semi-annual
11
- and quarterly — from **China, Korea and Japan** as clean **Markdown**, ready for LLM reading
12
- and RAG. Query by FMP-style symbol (`600519.SS`, `005930.KS`, `7203.T`) or filter by exchange,
13
- report period, or **section** — pull just the MD&A / risk section instead of the whole report.
14
- Reports are sourced from official disclosure platforms and parsed into structured Markdown with
15
- YAML frontmatter, preserved headings, paragraphs and tables.
11
+ and quarterly — from **China, Korea, Japan and Taiwan** as clean **Markdown**, ready for LLM reading
12
+ and RAG. Query by FMP-style symbol (`600519.SS`, `005930.KS`, `7203.T`, `2330.TW`) or filter by
13
+ exchange, report period, or **section** — pull just the MD&A / risk section instead of the whole
14
+ report. Reports are sourced from official disclosure platforms and parsed into structured Markdown
15
+ with YAML frontmatter, preserved headings, paragraphs and tables.
16
16
 
17
17
  ---
18
18
 
19
19
  ## MCP server
20
20
 
21
- Ship DataSinking to any AI agent (Claude Desktop / Cursor / Codex / Windsurf) as an
21
+ Ship DataSinking to any AI agent (Claude / Cursor / Codex / Windsurf) as an
22
22
  [MCP](https://modelcontextprotocol.io) server — 6 tools: list exchanges, list stocks,
23
23
  list reports, fetch a report, list sections, fetch one section (token-friendly for RAG).
24
24
 
25
+ ### Hosted — nothing to install
26
+
27
+ Point any MCP client at our endpoint and you're done. No package, no Python, no local server:
28
+
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "datasinking": {
33
+ "type": "http",
34
+ "url": "https://api.datasink.ing/mcp?apikey=YOUR_KEY"
35
+ }
36
+ }
37
+ }
38
+ ```
39
+
40
+ Claude Code, in one line:
41
+
42
+ ```bash
43
+ claude mcp add --transport http datasinking https://api.datasink.ing/mcp \
44
+ --header "Authorization: Bearer YOUR_KEY"
45
+ ```
46
+
47
+ Your key rides inside the URL, so treat that config as a secret. Clients that support custom
48
+ headers can send `Authorization: Bearer YOUR_KEY` instead — Claude Code redacts headers in its
49
+ output but can't redact a URL.
50
+
51
+ ### Local — run it yourself
52
+
53
+ If you'd rather keep everything on your own machine, there are two identical builds — pick
54
+ whichever runtime you already have:
55
+
56
+ **Node 18+ (no Python needed):**
57
+
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "datasinking": {
62
+ "command": "npx",
63
+ "args": ["-y", "datasinking-mcp"],
64
+ "env": { "DATASINK_API_KEY": "YOUR_KEY" }
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ **Python 3.8+:**
71
+
25
72
  ```bash
26
73
  pip install "datasinking[mcp]"
27
74
  datasinking-mcp # requires DATASINK_API_KEY (free at https://datasink.ing)
28
75
  ```
29
76
 
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).
77
+ Then use `command: datasinking-mcp` in your client.
78
+
79
+ Both run the same six tools with the same schemas — `npm/` and `datasinking/mcp_server.py` are
80
+ kept in lockstep by [`check_mcp_parity.py`](check_mcp_parity.py).
81
+
82
+ Full per-client setup: [`mcp-server.md`](mcp-server.md).
32
83
 
33
84
  ![DataSinking MCP in Claude](docs/images/mcp-demo.png)
34
85
 
@@ -41,6 +92,7 @@ datasinking/
41
92
  ├── examples/ # Example scripts: pull data from the API and analyze it
42
93
  ├── research/ # Research notes / blog posts (reproducing paper-style presentation)
43
94
  ├── datasinking/ # Python client + MCP server — pip install "datasinking[mcp]"
95
+ ├── npm/ # The same MCP server on npm — npx -y datasinking-mcp (Node 18+)
44
96
  ├── mcp-server.md # How to configure the MCP server (for AI agents: Claude / Cursor / Codex / DeepSeek)
45
97
  ├── llm-examples.md # Ask an LLM — no code needed (8 end-to-end examples)
46
98
  ├── api-examples.md # 7 examples × 3 interfaces (curl / Python / LLM)
@@ -8,4 +8,4 @@ pyproject.toml 用 `dynamic = ["version"]` 从这里读,`client.py` 的 User-A
8
8
  写着旧版本)。现在只有这一处需要改。
9
9
  """
10
10
 
11
- __version__ = "0.2.8"
11
+ __version__ = "0.2.10"
@@ -2,7 +2,7 @@
2
2
  """DataSinking MCP server (Model Context Protocol).
3
3
 
4
4
  Expose the DataSinking API — full-text financial reports across Asia
5
- (China, Korea, Japan) as clean Markdown — to AI agents (Claude, Cursor,
5
+ (China, Korea, Japan, Taiwan) as clean Markdown — to AI agents (Claude, Cursor,
6
6
  Codex, DeepSeek, Windsurf, …).
7
7
 
8
8
  Install the MCP extra::
@@ -70,7 +70,7 @@ def _get(path: str, params: Optional[dict] = None) -> dict:
70
70
 
71
71
  @mcp.tool()
72
72
  def list_exchanges() -> list:
73
- """List the exchanges DataSinking covers and their report counts.
73
+ """List the exchanges DataSinking covers.
74
74
 
75
75
  Returns exchange codes (sse / szse / bj / ksc / koe / knx / jpx / twse / tpex) with
76
76
  the number of reports available per exchange. Call this first to discover coverage.
@@ -82,13 +82,13 @@ def list_exchanges() -> list:
82
82
  @mcp.tool()
83
83
  def list_stocks(
84
84
  exchange: Annotated[
85
- str, Field(description="Exchange code: sse / szse / bj / ksc / koe / knx / jpx / twse / tpex")
85
+ str, Field(description="Exchange code, e.g. sse / szse / bj / ksc / koe / knx / jpx / twse / tpex")
86
86
  ],
87
87
  limit: Annotated[
88
88
  int, Field(description="Return only the first N companies (default 20) to keep the response short.")
89
89
  ] = 20,
90
90
  ) -> dict:
91
- """List stocks on an exchange, including the report count per company."""
91
+ """List the stocks on one exchange, including the report count per company."""
92
92
  data = _get("/stocks", {"exchange": exchange})
93
93
  return {"exchange": exchange, "total": data.get("total", 0), "items": data.get("items", [])[:limit]}
94
94
 
@@ -99,13 +99,13 @@ def list_reports(
99
99
  str, Field(description="FMP-style symbol, e.g. 600519.SS / 005930.KS / 7203.T / 2330.TW")
100
100
  ],
101
101
  doc_type: Annotated[
102
- str, Field(description="annual / semiannual / q1 / q3")
102
+ str, Field(description="Report type to filter on. Defaults to annual.")
103
103
  ] = "annual",
104
104
  size: Annotated[int, Field(description="Number of reports to return (default 10).")] = 10,
105
105
  ) -> dict:
106
106
  """List a company's reports — metadata only (id, title, period), no body text.
107
107
 
108
- Each item carries a ``source`` field naming the official disclosure platform;
108
+ Each item carries a `source` field naming the official disclosure platform;
109
109
  keep that attribution when you cite it.
110
110
  """
111
111
  return _get("/documents", {"symbol": symbol, "doc_type": doc_type, "size": size})
@@ -115,9 +115,9 @@ def list_reports(
115
115
  def get_report(
116
116
  document_id: Annotated[int, Field(description="Report id, from list_reports items[].id")],
117
117
  ) -> dict:
118
- """Fetch a single report's full text (metadata + Markdown body).
118
+ """Fetch one report's full text (metadata + Markdown body).
119
119
 
120
- The ``source`` field names the official disclosure platform; keep that attribution
120
+ The `source` field names the official disclosure platform; keep that attribution
121
121
  when you cite it. Expensive in tokens — prefer get_section when you only need one chapter.
122
122
  """
123
123
  return _get(f"/documents/{document_id}")
@@ -127,10 +127,15 @@ def get_report(
127
127
  def list_sections(
128
128
  document_id: Annotated[int, Field(description="Report id, from list_reports items[].id")],
129
129
  ) -> dict:
130
- """List every section heading in a report (feed the headings to get_section).
130
+ """List every section of a report with its size, before you decide what to pull.
131
131
 
132
- Call this before get_section to see the exact headings the headings are in the
133
- report's own language.
132
+ Returns `sections` (titles, in order) plus `section_details`same order, one entry
133
+ per section with `title`, `has_tables`, `chars` and `estimated_tokens`.
134
+
135
+ Use `estimated_tokens` to avoid pulling a chapter that would blow your context,
136
+ and `has_tables` to know whether the chapter needs special handling (tables are the
137
+ part RAG pipelines usually get wrong). Then call get_section with a heading keyword —
138
+ the headings are in the report's own language.
134
139
  """
135
140
  return _get(f"/documents/{document_id}/sections")
136
141
 
@@ -152,7 +157,7 @@ def get_section(
152
157
  ),
153
158
  ],
154
159
  ) -> dict:
155
- """Fetch only one section of a report by keyword — cheaper than get_report for RAG."""
160
+ """Fetch only one section of a report by keyword — much cheaper than get_report, best for RAG."""
156
161
  return _get(f"/documents/{document_id}", {"section": section})
157
162
 
158
163
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datasinking
3
- Version: 0.2.8
3
+ Version: 0.2.10
4
4
  Summary: Python client for DataSinking — full-text Asian financial reports (China, Korea, Japan, Taiwan) as Markdown.
5
5
  Author: DataSinking
6
6
  License: MIT
@@ -31,27 +31,78 @@ Dynamic: license-file
31
31
  **Full-text financial reports across Asia, as clean Markdown.**
32
32
 
33
33
  [DataSinking](https://datasink.ing) serves **full-text financial reports** — annual, semi-annual
34
- and quarterly — from **China, Korea and Japan** as clean **Markdown**, ready for LLM reading
35
- and RAG. Query by FMP-style symbol (`600519.SS`, `005930.KS`, `7203.T`) or filter by exchange,
36
- report period, or **section** — pull just the MD&A / risk section instead of the whole report.
37
- Reports are sourced from official disclosure platforms and parsed into structured Markdown with
38
- YAML frontmatter, preserved headings, paragraphs and tables.
34
+ and quarterly — from **China, Korea, Japan and Taiwan** as clean **Markdown**, ready for LLM reading
35
+ and RAG. Query by FMP-style symbol (`600519.SS`, `005930.KS`, `7203.T`, `2330.TW`) or filter by
36
+ exchange, report period, or **section** — pull just the MD&A / risk section instead of the whole
37
+ report. Reports are sourced from official disclosure platforms and parsed into structured Markdown
38
+ with YAML frontmatter, preserved headings, paragraphs and tables.
39
39
 
40
40
  ---
41
41
 
42
42
  ## MCP server
43
43
 
44
- Ship DataSinking to any AI agent (Claude Desktop / Cursor / Codex / Windsurf) as an
44
+ Ship DataSinking to any AI agent (Claude / Cursor / Codex / Windsurf) as an
45
45
  [MCP](https://modelcontextprotocol.io) server — 6 tools: list exchanges, list stocks,
46
46
  list reports, fetch a report, list sections, fetch one section (token-friendly for RAG).
47
47
 
48
+ ### Hosted — nothing to install
49
+
50
+ Point any MCP client at our endpoint and you're done. No package, no Python, no local server:
51
+
52
+ ```json
53
+ {
54
+ "mcpServers": {
55
+ "datasinking": {
56
+ "type": "http",
57
+ "url": "https://api.datasink.ing/mcp?apikey=YOUR_KEY"
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ Claude Code, in one line:
64
+
65
+ ```bash
66
+ claude mcp add --transport http datasinking https://api.datasink.ing/mcp \
67
+ --header "Authorization: Bearer YOUR_KEY"
68
+ ```
69
+
70
+ Your key rides inside the URL, so treat that config as a secret. Clients that support custom
71
+ headers can send `Authorization: Bearer YOUR_KEY` instead — Claude Code redacts headers in its
72
+ output but can't redact a URL.
73
+
74
+ ### Local — run it yourself
75
+
76
+ If you'd rather keep everything on your own machine, there are two identical builds — pick
77
+ whichever runtime you already have:
78
+
79
+ **Node 18+ (no Python needed):**
80
+
81
+ ```json
82
+ {
83
+ "mcpServers": {
84
+ "datasinking": {
85
+ "command": "npx",
86
+ "args": ["-y", "datasinking-mcp"],
87
+ "env": { "DATASINK_API_KEY": "YOUR_KEY" }
88
+ }
89
+ }
90
+ }
91
+ ```
92
+
93
+ **Python 3.8+:**
94
+
48
95
  ```bash
49
96
  pip install "datasinking[mcp]"
50
97
  datasinking-mcp # requires DATASINK_API_KEY (free at https://datasink.ing)
51
98
  ```
52
99
 
53
- Or add to your client with `command: datasinking-mcp`. A remote streamable-HTTP endpoint
54
- is also live at `https://api.datasink.ing/mcp`. See [`mcp-server.md`](mcp-server.md).
100
+ Then use `command: datasinking-mcp` in your client.
101
+
102
+ Both run the same six tools with the same schemas — `npm/` and `datasinking/mcp_server.py` are
103
+ kept in lockstep by [`check_mcp_parity.py`](check_mcp_parity.py).
104
+
105
+ Full per-client setup: [`mcp-server.md`](mcp-server.md).
55
106
 
56
107
  ![DataSinking MCP in Claude](docs/images/mcp-demo.png)
57
108
 
@@ -64,6 +115,7 @@ datasinking/
64
115
  ├── examples/ # Example scripts: pull data from the API and analyze it
65
116
  ├── research/ # Research notes / blog posts (reproducing paper-style presentation)
66
117
  ├── datasinking/ # Python client + MCP server — pip install "datasinking[mcp]"
118
+ ├── npm/ # The same MCP server on npm — npx -y datasinking-mcp (Node 18+)
67
119
  ├── mcp-server.md # How to configure the MCP server (for AI agents: Claude / Cursor / Codex / DeepSeek)
68
120
  ├── llm-examples.md # Ask an LLM — no code needed (8 end-to-end examples)
69
121
  ├── api-examples.md # 7 examples × 3 interfaces (curl / Python / LLM)
File without changes
File without changes
File without changes