reportify-sdk 0.2.10__tar.gz → 0.3.1__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.
- {reportify_sdk-0.2.10/reportify_sdk.egg-info → reportify_sdk-0.3.1}/PKG-INFO +102 -7
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/README.md +101 -6
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/pyproject.toml +1 -1
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/__init__.py +1 -1
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/chat.py +1 -1
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/client.py +1 -1
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/docs.py +4 -4
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/quant.py +57 -0
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/search.py +8 -8
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/stock.py +2 -2
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1/reportify_sdk.egg-info}/PKG-INFO +102 -7
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/LICENSE +0 -0
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/agent.py +0 -0
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/channels.py +0 -0
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/concepts.py +0 -0
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/exceptions.py +0 -0
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/kb.py +0 -0
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/timeline.py +0 -0
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk/user.py +0 -0
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk.egg-info/SOURCES.txt +0 -0
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk.egg-info/dependency_links.txt +0 -0
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk.egg-info/requires.txt +0 -0
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/reportify_sdk.egg-info/top_level.txt +0 -0
- {reportify_sdk-0.2.10 → reportify_sdk-0.3.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reportify-sdk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Python SDK for Reportify API - Financial data and document search
|
|
5
5
|
Author-email: Reportify <support@reportify.cn>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -75,19 +75,18 @@ balance = client.stock.balance_sheet("US:AAPL")
|
|
|
75
75
|
cashflow = client.stock.cashflow_statement("US:AAPL")
|
|
76
76
|
|
|
77
77
|
# Price data
|
|
78
|
-
prices = client.stock.prices("US:AAPL",
|
|
79
|
-
kline = client.stock.kline("US:TSLA", interval="1d", limit=100)
|
|
78
|
+
prices = client.stock.prices("US:AAPL", start_date="2024-01-01")
|
|
80
79
|
|
|
81
|
-
# Real-time
|
|
82
|
-
|
|
80
|
+
# Real-time quote
|
|
81
|
+
quote = client.stock.quote("US:AAPL")
|
|
83
82
|
|
|
84
83
|
# Company info
|
|
85
84
|
overview = client.stock.overview("US:AAPL")
|
|
86
85
|
shareholders = client.stock.shareholders("US:AAPL")
|
|
87
86
|
|
|
88
87
|
# Screening and calendar
|
|
89
|
-
stocks = client.stock.screener(
|
|
90
|
-
earnings = client.stock.earnings_calendar(
|
|
88
|
+
stocks = client.stock.screener(country="US", market_cap_more_than=1e10)
|
|
89
|
+
earnings = client.stock.earnings_calendar(market="us", start_date="2024-01-01", end_date="2024-01-31")
|
|
91
90
|
```
|
|
92
91
|
|
|
93
92
|
### Timeline
|
|
@@ -118,6 +117,102 @@ summary = client.docs.summary("doc_id")
|
|
|
118
117
|
# List and search documents
|
|
119
118
|
docs = client.docs.list(symbols=["US:AAPL"], page_size=10)
|
|
120
119
|
chunks = client.docs.search_chunks("revenue breakdown", num=5)
|
|
120
|
+
|
|
121
|
+
# Upload documents
|
|
122
|
+
result = client.docs.upload([
|
|
123
|
+
{"url": "https://example.com/report.pdf", "name": "Annual Report"}
|
|
124
|
+
])
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Quant (Quantitative Analysis)
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
# Compute technical indicators
|
|
131
|
+
df = client.quant.compute_indicators(["000001"], "RSI(14)")
|
|
132
|
+
df = client.quant.compute_indicators(["000001"], "MACD()")
|
|
133
|
+
|
|
134
|
+
# Screen stocks by formula
|
|
135
|
+
stocks = client.quant.screen(formula="RSI(14) < 30")
|
|
136
|
+
stocks = client.quant.screen(formula="CROSS(MA(5), MA(20))")
|
|
137
|
+
|
|
138
|
+
# Get OHLCV data
|
|
139
|
+
ohlcv = client.quant.ohlcv("000001", start_date="2024-01-01")
|
|
140
|
+
ohlcv_batch = client.quant.ohlcv_batch(["000001", "600519"])
|
|
141
|
+
|
|
142
|
+
# Backtest strategy
|
|
143
|
+
result = client.quant.backtest(
|
|
144
|
+
start_date="2023-01-01",
|
|
145
|
+
end_date="2024-01-01",
|
|
146
|
+
symbol="000001",
|
|
147
|
+
entry_formula="CROSS(MA(5), MA(20))",
|
|
148
|
+
exit_formula="CROSSDOWN(MA(5), MA(20))"
|
|
149
|
+
)
|
|
150
|
+
print(f"Total Return: {result['total_return_pct']:.2%}")
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Concepts
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
# Get latest concepts
|
|
157
|
+
concepts = client.concepts.latest()
|
|
158
|
+
for c in concepts:
|
|
159
|
+
print(c["concept_name"])
|
|
160
|
+
|
|
161
|
+
# Get today's concept feeds
|
|
162
|
+
feeds = client.concepts.today()
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Channels
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
# Search channels
|
|
169
|
+
result = client.channels.search("Goldman Sachs")
|
|
170
|
+
|
|
171
|
+
# Get followed channels
|
|
172
|
+
followings = client.channels.followings()
|
|
173
|
+
|
|
174
|
+
# Follow/unfollow a channel
|
|
175
|
+
client.channels.follow("channel_id")
|
|
176
|
+
client.channels.unfollow("channel_id")
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Chat
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
# Chat completion based on documents
|
|
183
|
+
response = client.chat.completion(
|
|
184
|
+
"What are Tesla's revenue projections?",
|
|
185
|
+
symbols=["US:TSLA"],
|
|
186
|
+
mode="comprehensive" # concise, comprehensive, deepresearch
|
|
187
|
+
)
|
|
188
|
+
print(response["message"])
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Agent
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
# Create agent conversation
|
|
195
|
+
conv = client.agent.create_conversation(agent_id=11887655289749510)
|
|
196
|
+
|
|
197
|
+
# Chat with agent
|
|
198
|
+
response = client.agent.chat(
|
|
199
|
+
conversation_id=conv["id"],
|
|
200
|
+
message="Analyze NVIDIA's latest earnings"
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
# Get agent-generated file
|
|
204
|
+
file_content = client.agent.get_file("file_id")
|
|
205
|
+
with open("output.xlsx", "wb") as f:
|
|
206
|
+
f.write(file_content)
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### User
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
# Get followed companies
|
|
213
|
+
companies = client.user.followed_companies()
|
|
214
|
+
for company in companies:
|
|
215
|
+
print(f"{company['symbol']}: {company['name']}")
|
|
121
216
|
```
|
|
122
217
|
|
|
123
218
|
## Error Handling
|
|
@@ -46,19 +46,18 @@ balance = client.stock.balance_sheet("US:AAPL")
|
|
|
46
46
|
cashflow = client.stock.cashflow_statement("US:AAPL")
|
|
47
47
|
|
|
48
48
|
# Price data
|
|
49
|
-
prices = client.stock.prices("US:AAPL",
|
|
50
|
-
kline = client.stock.kline("US:TSLA", interval="1d", limit=100)
|
|
49
|
+
prices = client.stock.prices("US:AAPL", start_date="2024-01-01")
|
|
51
50
|
|
|
52
|
-
# Real-time
|
|
53
|
-
|
|
51
|
+
# Real-time quote
|
|
52
|
+
quote = client.stock.quote("US:AAPL")
|
|
54
53
|
|
|
55
54
|
# Company info
|
|
56
55
|
overview = client.stock.overview("US:AAPL")
|
|
57
56
|
shareholders = client.stock.shareholders("US:AAPL")
|
|
58
57
|
|
|
59
58
|
# Screening and calendar
|
|
60
|
-
stocks = client.stock.screener(
|
|
61
|
-
earnings = client.stock.earnings_calendar(
|
|
59
|
+
stocks = client.stock.screener(country="US", market_cap_more_than=1e10)
|
|
60
|
+
earnings = client.stock.earnings_calendar(market="us", start_date="2024-01-01", end_date="2024-01-31")
|
|
62
61
|
```
|
|
63
62
|
|
|
64
63
|
### Timeline
|
|
@@ -89,6 +88,102 @@ summary = client.docs.summary("doc_id")
|
|
|
89
88
|
# List and search documents
|
|
90
89
|
docs = client.docs.list(symbols=["US:AAPL"], page_size=10)
|
|
91
90
|
chunks = client.docs.search_chunks("revenue breakdown", num=5)
|
|
91
|
+
|
|
92
|
+
# Upload documents
|
|
93
|
+
result = client.docs.upload([
|
|
94
|
+
{"url": "https://example.com/report.pdf", "name": "Annual Report"}
|
|
95
|
+
])
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Quant (Quantitative Analysis)
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
# Compute technical indicators
|
|
102
|
+
df = client.quant.compute_indicators(["000001"], "RSI(14)")
|
|
103
|
+
df = client.quant.compute_indicators(["000001"], "MACD()")
|
|
104
|
+
|
|
105
|
+
# Screen stocks by formula
|
|
106
|
+
stocks = client.quant.screen(formula="RSI(14) < 30")
|
|
107
|
+
stocks = client.quant.screen(formula="CROSS(MA(5), MA(20))")
|
|
108
|
+
|
|
109
|
+
# Get OHLCV data
|
|
110
|
+
ohlcv = client.quant.ohlcv("000001", start_date="2024-01-01")
|
|
111
|
+
ohlcv_batch = client.quant.ohlcv_batch(["000001", "600519"])
|
|
112
|
+
|
|
113
|
+
# Backtest strategy
|
|
114
|
+
result = client.quant.backtest(
|
|
115
|
+
start_date="2023-01-01",
|
|
116
|
+
end_date="2024-01-01",
|
|
117
|
+
symbol="000001",
|
|
118
|
+
entry_formula="CROSS(MA(5), MA(20))",
|
|
119
|
+
exit_formula="CROSSDOWN(MA(5), MA(20))"
|
|
120
|
+
)
|
|
121
|
+
print(f"Total Return: {result['total_return_pct']:.2%}")
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Concepts
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
# Get latest concepts
|
|
128
|
+
concepts = client.concepts.latest()
|
|
129
|
+
for c in concepts:
|
|
130
|
+
print(c["concept_name"])
|
|
131
|
+
|
|
132
|
+
# Get today's concept feeds
|
|
133
|
+
feeds = client.concepts.today()
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Channels
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
# Search channels
|
|
140
|
+
result = client.channels.search("Goldman Sachs")
|
|
141
|
+
|
|
142
|
+
# Get followed channels
|
|
143
|
+
followings = client.channels.followings()
|
|
144
|
+
|
|
145
|
+
# Follow/unfollow a channel
|
|
146
|
+
client.channels.follow("channel_id")
|
|
147
|
+
client.channels.unfollow("channel_id")
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Chat
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
# Chat completion based on documents
|
|
154
|
+
response = client.chat.completion(
|
|
155
|
+
"What are Tesla's revenue projections?",
|
|
156
|
+
symbols=["US:TSLA"],
|
|
157
|
+
mode="comprehensive" # concise, comprehensive, deepresearch
|
|
158
|
+
)
|
|
159
|
+
print(response["message"])
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Agent
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
# Create agent conversation
|
|
166
|
+
conv = client.agent.create_conversation(agent_id=11887655289749510)
|
|
167
|
+
|
|
168
|
+
# Chat with agent
|
|
169
|
+
response = client.agent.chat(
|
|
170
|
+
conversation_id=conv["id"],
|
|
171
|
+
message="Analyze NVIDIA's latest earnings"
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
# Get agent-generated file
|
|
175
|
+
file_content = client.agent.get_file("file_id")
|
|
176
|
+
with open("output.xlsx", "wb") as f:
|
|
177
|
+
f.write(file_content)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### User
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
# Get followed companies
|
|
184
|
+
companies = client.user.followed_companies()
|
|
185
|
+
for company in companies:
|
|
186
|
+
print(f"{company['symbol']}: {company['name']}")
|
|
92
187
|
```
|
|
93
188
|
|
|
94
189
|
## Error Handling
|
|
@@ -54,7 +54,7 @@ class ChatModule:
|
|
|
54
54
|
categories: Filter by document categories
|
|
55
55
|
markets: Filter by markets (cn, hk, us)
|
|
56
56
|
institutions: Filter by institutions
|
|
57
|
-
symbols:
|
|
57
|
+
symbols: Stock symbols in market:ticker format (e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
58
58
|
tags: Filter by tags
|
|
59
59
|
start_date: Start date filter (YYYY-MM-DD)
|
|
60
60
|
end_date: End date filter (YYYY-MM-DD)
|
|
@@ -101,7 +101,7 @@ class DocsModule:
|
|
|
101
101
|
List documents with filters
|
|
102
102
|
|
|
103
103
|
Args:
|
|
104
|
-
symbols:
|
|
104
|
+
symbols: Stock symbols in market:ticker format (e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
105
105
|
categories: Filter by document categories (financials, transcripts, reports, news, files, filings, socials)
|
|
106
106
|
markets: Filter by markets (cn, hk, us)
|
|
107
107
|
institutions: Filter by institutions
|
|
@@ -176,7 +176,7 @@ class DocsModule:
|
|
|
176
176
|
|
|
177
177
|
Args:
|
|
178
178
|
query: Search query string
|
|
179
|
-
symbols:
|
|
179
|
+
symbols: Stock symbols in market:ticker format (e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
180
180
|
categories: Filter by document categories (financials, transcripts, reports, news, filings, socials)
|
|
181
181
|
markets: Filter by markets (cn, hk, us)
|
|
182
182
|
institutions: Filter by institutions
|
|
@@ -251,7 +251,7 @@ class DocsModule:
|
|
|
251
251
|
Query documents by stock symbols
|
|
252
252
|
|
|
253
253
|
Args:
|
|
254
|
-
symbols: Stock symbols
|
|
254
|
+
symbols: Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
255
255
|
categories: Filter by document categories
|
|
256
256
|
markets: Filter by markets (cn, hk, us)
|
|
257
257
|
start_date: Start date filter (YYYY-MM-DD)
|
|
@@ -345,7 +345,7 @@ class DocsModule:
|
|
|
345
345
|
|
|
346
346
|
Args:
|
|
347
347
|
query: Search query string
|
|
348
|
-
symbols:
|
|
348
|
+
symbols: Stock symbols in market:ticker format (e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
349
349
|
categories: Filter by document categories
|
|
350
350
|
markets: Filter by markets (cn, hk, us)
|
|
351
351
|
institutions: Filter by institutions
|
|
@@ -315,6 +315,63 @@ class QuantModule:
|
|
|
315
315
|
response = self._client._post("/v1/quant/quotes/ohlcv/batch", json=data)
|
|
316
316
|
return self._to_dataframe(response.get("datas", []))
|
|
317
317
|
|
|
318
|
+
# -------------------------------------------------------------------------
|
|
319
|
+
# Financials
|
|
320
|
+
# -------------------------------------------------------------------------
|
|
321
|
+
|
|
322
|
+
def financials(
|
|
323
|
+
self,
|
|
324
|
+
financial_type: Literal["income", "cashflow", "balancesheet", "equity"],
|
|
325
|
+
symbol: str,
|
|
326
|
+
*,
|
|
327
|
+
market: StockMarket = "cn",
|
|
328
|
+
start_year: int | None = None,
|
|
329
|
+
end_year: int | None = None,
|
|
330
|
+
) -> pd.DataFrame:
|
|
331
|
+
"""
|
|
332
|
+
Get historical financial statement data for a single symbol
|
|
333
|
+
|
|
334
|
+
Args:
|
|
335
|
+
financial_type: Type of financial statement
|
|
336
|
+
- "income": Income statement (利润表)
|
|
337
|
+
- "cashflow": Cash flow statement (现金流量表)
|
|
338
|
+
- "balancesheet": Balance sheet (资产负债表)
|
|
339
|
+
- "equity": Equity statement (股东权益变动表)
|
|
340
|
+
symbol: Stock code
|
|
341
|
+
market: Stock market ("cn", "hk", "us"), default "cn"
|
|
342
|
+
start_year: Start year (default: 3 years ago)
|
|
343
|
+
end_year: End year (default: current year)
|
|
344
|
+
|
|
345
|
+
Returns:
|
|
346
|
+
DataFrame with financial data sorted by report period
|
|
347
|
+
|
|
348
|
+
Example:
|
|
349
|
+
>>> # Get income statement
|
|
350
|
+
>>> df = client.quant.financials("income", "000001")
|
|
351
|
+
>>> print(df[["report_period", "revenue", "net_profit"]])
|
|
352
|
+
|
|
353
|
+
>>> # Get balance sheet for specific years
|
|
354
|
+
>>> df = client.quant.financials(
|
|
355
|
+
... "balancesheet", "600519",
|
|
356
|
+
... start_year=2020,
|
|
357
|
+
... end_year=2024
|
|
358
|
+
... )
|
|
359
|
+
|
|
360
|
+
>>> # Get cash flow statement for HK stock
|
|
361
|
+
>>> df = client.quant.financials("cashflow", "00700", market="hk")
|
|
362
|
+
"""
|
|
363
|
+
params: dict[str, Any] = {
|
|
364
|
+
"symbol": symbol,
|
|
365
|
+
"market": market,
|
|
366
|
+
}
|
|
367
|
+
if start_year:
|
|
368
|
+
params["start_year"] = start_year
|
|
369
|
+
if end_year:
|
|
370
|
+
params["end_year"] = end_year
|
|
371
|
+
|
|
372
|
+
response = self._client._get(f"/v1/quant/financials/{financial_type}", params=params)
|
|
373
|
+
return self._to_dataframe(response.get("datas", []))
|
|
374
|
+
|
|
318
375
|
# -------------------------------------------------------------------------
|
|
319
376
|
# Backtest
|
|
320
377
|
# -------------------------------------------------------------------------
|
|
@@ -44,7 +44,7 @@ class SearchModule:
|
|
|
44
44
|
query: Search query string
|
|
45
45
|
num: Number of results to return (default: 10, max: 100)
|
|
46
46
|
categories: Filter by categories (news, reports, filings, transcripts, socials)
|
|
47
|
-
symbols:
|
|
47
|
+
symbols: Stock symbols in market:ticker format (e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
48
48
|
industries: Filter by industries
|
|
49
49
|
channel_ids: Filter by channel IDs
|
|
50
50
|
start_datetime: Start datetime filter (YYYY-MM-DD or YYYY-MM-DD HH:MM:SS)
|
|
@@ -86,7 +86,7 @@ class SearchModule:
|
|
|
86
86
|
Args:
|
|
87
87
|
query: Search query string
|
|
88
88
|
num: Number of results to return
|
|
89
|
-
symbols:
|
|
89
|
+
symbols: Stock symbols in market:ticker format (e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
90
90
|
channel_ids: Filter by channel IDs
|
|
91
91
|
start_datetime: Start datetime filter
|
|
92
92
|
end_datetime: End datetime filter
|
|
@@ -124,7 +124,7 @@ class SearchModule:
|
|
|
124
124
|
Args:
|
|
125
125
|
query: Search query string
|
|
126
126
|
num: Number of results to return
|
|
127
|
-
symbols:
|
|
127
|
+
symbols: Stock symbols in market:ticker format (e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
128
128
|
industries: Filter by industries
|
|
129
129
|
channel_ids: Filter by channel IDs
|
|
130
130
|
start_datetime: Start datetime filter
|
|
@@ -162,7 +162,7 @@ class SearchModule:
|
|
|
162
162
|
|
|
163
163
|
Args:
|
|
164
164
|
query: Search query string
|
|
165
|
-
symbols: Stock symbols
|
|
165
|
+
symbols: Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
166
166
|
num: Number of results to return
|
|
167
167
|
start_datetime: Start datetime filter
|
|
168
168
|
end_datetime: End datetime filter
|
|
@@ -195,7 +195,7 @@ class SearchModule:
|
|
|
195
195
|
|
|
196
196
|
Args:
|
|
197
197
|
query: Search query string
|
|
198
|
-
symbols: Stock symbols
|
|
198
|
+
symbols: Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
199
199
|
num: Number of results to return
|
|
200
200
|
start_datetime: Start datetime filter (YYYY-MM-DD or YYYY-MM-DD HH:MM:SS)
|
|
201
201
|
end_datetime: End datetime filter (YYYY-MM-DD or YYYY-MM-DD HH:MM:SS)
|
|
@@ -234,7 +234,7 @@ class SearchModule:
|
|
|
234
234
|
|
|
235
235
|
Args:
|
|
236
236
|
query: Search query string
|
|
237
|
-
symbols: Stock symbols
|
|
237
|
+
symbols: Stock symbols in market:ticker format (required, e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
238
238
|
num: Number of results to return
|
|
239
239
|
start_datetime: Start datetime filter (YYYY-MM-DD or YYYY-MM-DD HH:MM:SS)
|
|
240
240
|
end_datetime: End datetime filter (YYYY-MM-DD or YYYY-MM-DD HH:MM:SS)
|
|
@@ -272,7 +272,7 @@ class SearchModule:
|
|
|
272
272
|
Args:
|
|
273
273
|
query: Search query string
|
|
274
274
|
num: Number of results to return
|
|
275
|
-
symbols:
|
|
275
|
+
symbols: Stock symbols in market:ticker format (e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
276
276
|
start_datetime: Start datetime filter
|
|
277
277
|
end_datetime: End datetime filter
|
|
278
278
|
|
|
@@ -306,7 +306,7 @@ class SearchModule:
|
|
|
306
306
|
Args:
|
|
307
307
|
query: Search query string
|
|
308
308
|
num: Number of results to return
|
|
309
|
-
symbols:
|
|
309
|
+
symbols: Stock symbols in market:ticker format (e.g., US:AAPL, HK:00700, SH:600519, SZ:000001)
|
|
310
310
|
channel_ids: Filter by channel IDs
|
|
311
311
|
start_datetime: Start datetime filter
|
|
312
312
|
end_datetime: End datetime filter
|
|
@@ -118,7 +118,7 @@ class StockModule:
|
|
|
118
118
|
Get income statement data
|
|
119
119
|
|
|
120
120
|
Args:
|
|
121
|
-
symbol: Stock symbol
|
|
121
|
+
symbol: Stock symbol
|
|
122
122
|
period: Report cycle ("annual", "quarterly", "cumulative quarterly")
|
|
123
123
|
limit: Return latest N records (default: 8)
|
|
124
124
|
start_date: Start date (YYYY-MM-DD)
|
|
@@ -329,7 +329,7 @@ class StockModule:
|
|
|
329
329
|
Get real-time stock quote
|
|
330
330
|
|
|
331
331
|
Args:
|
|
332
|
-
symbol: Stock symbol
|
|
332
|
+
symbol: Stock symbol
|
|
333
333
|
|
|
334
334
|
Returns:
|
|
335
335
|
DataFrame with real-time quote data
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reportify-sdk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Python SDK for Reportify API - Financial data and document search
|
|
5
5
|
Author-email: Reportify <support@reportify.cn>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -75,19 +75,18 @@ balance = client.stock.balance_sheet("US:AAPL")
|
|
|
75
75
|
cashflow = client.stock.cashflow_statement("US:AAPL")
|
|
76
76
|
|
|
77
77
|
# Price data
|
|
78
|
-
prices = client.stock.prices("US:AAPL",
|
|
79
|
-
kline = client.stock.kline("US:TSLA", interval="1d", limit=100)
|
|
78
|
+
prices = client.stock.prices("US:AAPL", start_date="2024-01-01")
|
|
80
79
|
|
|
81
|
-
# Real-time
|
|
82
|
-
|
|
80
|
+
# Real-time quote
|
|
81
|
+
quote = client.stock.quote("US:AAPL")
|
|
83
82
|
|
|
84
83
|
# Company info
|
|
85
84
|
overview = client.stock.overview("US:AAPL")
|
|
86
85
|
shareholders = client.stock.shareholders("US:AAPL")
|
|
87
86
|
|
|
88
87
|
# Screening and calendar
|
|
89
|
-
stocks = client.stock.screener(
|
|
90
|
-
earnings = client.stock.earnings_calendar(
|
|
88
|
+
stocks = client.stock.screener(country="US", market_cap_more_than=1e10)
|
|
89
|
+
earnings = client.stock.earnings_calendar(market="us", start_date="2024-01-01", end_date="2024-01-31")
|
|
91
90
|
```
|
|
92
91
|
|
|
93
92
|
### Timeline
|
|
@@ -118,6 +117,102 @@ summary = client.docs.summary("doc_id")
|
|
|
118
117
|
# List and search documents
|
|
119
118
|
docs = client.docs.list(symbols=["US:AAPL"], page_size=10)
|
|
120
119
|
chunks = client.docs.search_chunks("revenue breakdown", num=5)
|
|
120
|
+
|
|
121
|
+
# Upload documents
|
|
122
|
+
result = client.docs.upload([
|
|
123
|
+
{"url": "https://example.com/report.pdf", "name": "Annual Report"}
|
|
124
|
+
])
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Quant (Quantitative Analysis)
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
# Compute technical indicators
|
|
131
|
+
df = client.quant.compute_indicators(["000001"], "RSI(14)")
|
|
132
|
+
df = client.quant.compute_indicators(["000001"], "MACD()")
|
|
133
|
+
|
|
134
|
+
# Screen stocks by formula
|
|
135
|
+
stocks = client.quant.screen(formula="RSI(14) < 30")
|
|
136
|
+
stocks = client.quant.screen(formula="CROSS(MA(5), MA(20))")
|
|
137
|
+
|
|
138
|
+
# Get OHLCV data
|
|
139
|
+
ohlcv = client.quant.ohlcv("000001", start_date="2024-01-01")
|
|
140
|
+
ohlcv_batch = client.quant.ohlcv_batch(["000001", "600519"])
|
|
141
|
+
|
|
142
|
+
# Backtest strategy
|
|
143
|
+
result = client.quant.backtest(
|
|
144
|
+
start_date="2023-01-01",
|
|
145
|
+
end_date="2024-01-01",
|
|
146
|
+
symbol="000001",
|
|
147
|
+
entry_formula="CROSS(MA(5), MA(20))",
|
|
148
|
+
exit_formula="CROSSDOWN(MA(5), MA(20))"
|
|
149
|
+
)
|
|
150
|
+
print(f"Total Return: {result['total_return_pct']:.2%}")
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Concepts
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
# Get latest concepts
|
|
157
|
+
concepts = client.concepts.latest()
|
|
158
|
+
for c in concepts:
|
|
159
|
+
print(c["concept_name"])
|
|
160
|
+
|
|
161
|
+
# Get today's concept feeds
|
|
162
|
+
feeds = client.concepts.today()
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Channels
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
# Search channels
|
|
169
|
+
result = client.channels.search("Goldman Sachs")
|
|
170
|
+
|
|
171
|
+
# Get followed channels
|
|
172
|
+
followings = client.channels.followings()
|
|
173
|
+
|
|
174
|
+
# Follow/unfollow a channel
|
|
175
|
+
client.channels.follow("channel_id")
|
|
176
|
+
client.channels.unfollow("channel_id")
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Chat
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
# Chat completion based on documents
|
|
183
|
+
response = client.chat.completion(
|
|
184
|
+
"What are Tesla's revenue projections?",
|
|
185
|
+
symbols=["US:TSLA"],
|
|
186
|
+
mode="comprehensive" # concise, comprehensive, deepresearch
|
|
187
|
+
)
|
|
188
|
+
print(response["message"])
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Agent
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
# Create agent conversation
|
|
195
|
+
conv = client.agent.create_conversation(agent_id=11887655289749510)
|
|
196
|
+
|
|
197
|
+
# Chat with agent
|
|
198
|
+
response = client.agent.chat(
|
|
199
|
+
conversation_id=conv["id"],
|
|
200
|
+
message="Analyze NVIDIA's latest earnings"
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
# Get agent-generated file
|
|
204
|
+
file_content = client.agent.get_file("file_id")
|
|
205
|
+
with open("output.xlsx", "wb") as f:
|
|
206
|
+
f.write(file_content)
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### User
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
# Get followed companies
|
|
213
|
+
companies = client.user.followed_companies()
|
|
214
|
+
for company in companies:
|
|
215
|
+
print(f"{company['symbol']}: {company['name']}")
|
|
121
216
|
```
|
|
122
217
|
|
|
123
218
|
## Error Handling
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|