reportify-sdk 0.2.10__py3-none-any.whl → 0.3.1__py3-none-any.whl

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/__init__.py CHANGED
@@ -20,7 +20,7 @@ from reportify_sdk.exceptions import (
20
20
  APIError,
21
21
  )
22
22
 
23
- __version__ = "0.2.10"
23
+ __version__ = "0.3.1"
24
24
  __all__ = [
25
25
  "Reportify",
26
26
  "ReportifyError",
reportify_sdk/chat.py CHANGED
@@ -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: Filter by stock 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)
reportify_sdk/client.py CHANGED
@@ -74,7 +74,7 @@ class Reportify:
74
74
  return {
75
75
  "Authorization": f"Bearer {self.api_key}",
76
76
  "Content-Type": "application/json",
77
- "User-Agent": "reportify-sdk-python/0.2.10",
77
+ "User-Agent": "reportify-sdk-python/0.3.1",
78
78
  }
79
79
 
80
80
  def _request(
reportify_sdk/docs.py CHANGED
@@ -101,7 +101,7 @@ class DocsModule:
101
101
  List documents with filters
102
102
 
103
103
  Args:
104
- symbols: Filter by stock 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: Filter by stock 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 to filter by (required)
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: Filter by stock 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
reportify_sdk/quant.py CHANGED
@@ -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
  # -------------------------------------------------------------------------
reportify_sdk/search.py CHANGED
@@ -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: Filter by stock symbols (e.g., ["US:AAPL", "HK:0700"])
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: Filter by stock 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: Filter by stock 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 to filter by (required)
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 to filter by (required)
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 to filter by (required)
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: Filter by stock 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: Filter by stock 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
reportify_sdk/stock.py CHANGED
@@ -118,7 +118,7 @@ class StockModule:
118
118
  Get income statement data
119
119
 
120
120
  Args:
121
- symbol: Stock symbol (e.g., "US:AAPL")
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 (e.g., "US:AAPL", "688001", "00700")
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.2.10
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", limit=30)
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 quotes
82
- quotes = client.stock.quote(["US:AAPL", "US:MSFT"])
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(market="US", min_market_cap=1e10)
90
- earnings = client.stock.earnings_calendar(area="us", start_date="2024-01-01")
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
@@ -0,0 +1,19 @@
1
+ reportify_sdk/__init__.py,sha256=EnQDmMSdKDtDP-in6pgEHvx224JTzWltM7AGVTBHMV8,662
2
+ reportify_sdk/agent.py,sha256=y1iP4Jq7-ESMxeCWB_vxkAvwCjUCWT8K-ZSeJswU6nQ,6358
3
+ reportify_sdk/channels.py,sha256=VbBCispCiP2Mzqn5lmBWVNWog4ElVni46mK2zg7KKzg,3518
4
+ reportify_sdk/chat.py,sha256=GQVfre4p2H9Kb0imX1-LvGqMrtnsuGhjQskBNUqUI_I,3613
5
+ reportify_sdk/client.py,sha256=fj5pMBXZSMgwfgj_BqD1Riqaz5PW4S7fTq7PXuRqkPM,8206
6
+ reportify_sdk/concepts.py,sha256=XlHPuuZacFFUccMthyeb5R2OTayFYxXgIODKNfJLa_c,1891
7
+ reportify_sdk/docs.py,sha256=PsOJrm-tFvvfHyVOWUptLC6wHhze5AMizD8MkcktEBo,16814
8
+ reportify_sdk/exceptions.py,sha256=r2_C_kTh6tCrQnfA3UozSqMMA-2OBnoP3pGpgYeqcdU,1049
9
+ reportify_sdk/kb.py,sha256=3e82_56hvnGQ2fI404g3DAem9javPY7OpE5B8goYOB8,2895
10
+ reportify_sdk/quant.py,sha256=BfhdKiimfC4tZDRkaMjssyoQJKy39aXbz2KfjShLiTg,17245
11
+ reportify_sdk/search.py,sha256=rzleME8_DwdiJ-__0qPjXkQZmaJ6JXH-ycJ_mUlkkNw,11866
12
+ reportify_sdk/stock.py,sha256=sBUYmbj3nz5HaOGF5HakRF5Qt9Y5veZA1U2vDRau2vw,21473
13
+ reportify_sdk/timeline.py,sha256=7ZbF5-0eGoF_N5h9swEyYgZSaMb54PMwLDXlaqFS4ns,5396
14
+ reportify_sdk/user.py,sha256=lsdhvaovllEwYiz4fhhSwl8PMX8tKswzABAvZbB0iJw,1261
15
+ reportify_sdk-0.3.1.dist-info/licenses/LICENSE,sha256=zBUq4DL4lE-fZU_PMkr0gnxkYS1LhdRHFw8_LmCb-ek,1066
16
+ reportify_sdk-0.3.1.dist-info/METADATA,sha256=Mc2ecqS81TS9UlR2_RrHp26RQsUkg5DTpXi6Sa9_4dE,6451
17
+ reportify_sdk-0.3.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
18
+ reportify_sdk-0.3.1.dist-info/top_level.txt,sha256=tc_dzCSWIDsNbHSi-FlyEEX8xwinhN9gl-CwyLRE4B0,14
19
+ reportify_sdk-0.3.1.dist-info/RECORD,,
@@ -1,19 +0,0 @@
1
- reportify_sdk/__init__.py,sha256=DLgFU-rq_NX0Xl420Qyt-gJehRnNhPsLaAwK3trr4Ms,663
2
- reportify_sdk/agent.py,sha256=y1iP4Jq7-ESMxeCWB_vxkAvwCjUCWT8K-ZSeJswU6nQ,6358
3
- reportify_sdk/channels.py,sha256=VbBCispCiP2Mzqn5lmBWVNWog4ElVni46mK2zg7KKzg,3518
4
- reportify_sdk/chat.py,sha256=w2KE8kO9PgL1uFSpBGI-8oD6pVhr0NF5ZAS_YoaFU5I,3551
5
- reportify_sdk/client.py,sha256=1pePkYX9vt0iG6z7yYxiXAwxbEZSqvyFdbFJBDzUM6E,8207
6
- reportify_sdk/concepts.py,sha256=XlHPuuZacFFUccMthyeb5R2OTayFYxXgIODKNfJLa_c,1891
7
- reportify_sdk/docs.py,sha256=6VylFci91gdV89tVKnaUgLYRF3suGEFTkO85VwK_ip4,16570
8
- reportify_sdk/exceptions.py,sha256=r2_C_kTh6tCrQnfA3UozSqMMA-2OBnoP3pGpgYeqcdU,1049
9
- reportify_sdk/kb.py,sha256=3e82_56hvnGQ2fI404g3DAem9javPY7OpE5B8goYOB8,2895
10
- reportify_sdk/quant.py,sha256=9rWKWo2UlG3GfsQC-jpEgXUl25ojEabpvOGISyGMamM,15110
11
- reportify_sdk/search.py,sha256=QChN1hDP0q_fEaDm_Sb8SnKwHqTMg6yzpPsFHHWZQVw,11413
12
- reportify_sdk/stock.py,sha256=DkZkLXAPVK4AbkjWRRe6OdjXjUyJD1JZz0hEXMjtT_Y,21528
13
- reportify_sdk/timeline.py,sha256=7ZbF5-0eGoF_N5h9swEyYgZSaMb54PMwLDXlaqFS4ns,5396
14
- reportify_sdk/user.py,sha256=lsdhvaovllEwYiz4fhhSwl8PMX8tKswzABAvZbB0iJw,1261
15
- reportify_sdk-0.2.10.dist-info/licenses/LICENSE,sha256=zBUq4DL4lE-fZU_PMkr0gnxkYS1LhdRHFw8_LmCb-ek,1066
16
- reportify_sdk-0.2.10.dist-info/METADATA,sha256=7zKml8JYyFUsjaeiasHMmWp-RDiZnFs17LztA_GRogs,4312
17
- reportify_sdk-0.2.10.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
18
- reportify_sdk-0.2.10.dist-info/top_level.txt,sha256=tc_dzCSWIDsNbHSi-FlyEEX8xwinhN9gl-CwyLRE4B0,14
19
- reportify_sdk-0.2.10.dist-info/RECORD,,