reportify-sdk 0.2.3__py3-none-any.whl → 0.2.5__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/stock.py +49 -7
- {reportify_sdk-0.2.3.dist-info → reportify_sdk-0.2.5.dist-info}/METADATA +1 -1
- {reportify_sdk-0.2.3.dist-info → reportify_sdk-0.2.5.dist-info}/RECORD +6 -6
- {reportify_sdk-0.2.3.dist-info → reportify_sdk-0.2.5.dist-info}/WHEEL +0 -0
- {reportify_sdk-0.2.3.dist-info → reportify_sdk-0.2.5.dist-info}/licenses/LICENSE +0 -0
- {reportify_sdk-0.2.3.dist-info → reportify_sdk-0.2.5.dist-info}/top_level.txt +0 -0
reportify_sdk/stock.py
CHANGED
|
@@ -353,7 +353,7 @@ class StockModule:
|
|
|
353
353
|
def earnings_calendar(
|
|
354
354
|
self,
|
|
355
355
|
*,
|
|
356
|
-
|
|
356
|
+
market: Literal["us", "hk", "cn"] = "us",
|
|
357
357
|
start_date: str | None = None,
|
|
358
358
|
end_date: str | None = None,
|
|
359
359
|
symbol: str | None = None,
|
|
@@ -362,7 +362,7 @@ class StockModule:
|
|
|
362
362
|
Get earnings announcement calendar
|
|
363
363
|
|
|
364
364
|
Args:
|
|
365
|
-
|
|
365
|
+
market: Stock market ("us", "hk", "cn")
|
|
366
366
|
start_date: Start date (YYYY-MM-DD)
|
|
367
367
|
end_date: End date (YYYY-MM-DD)
|
|
368
368
|
symbol: Filter by specific symbol
|
|
@@ -370,7 +370,7 @@ class StockModule:
|
|
|
370
370
|
Returns:
|
|
371
371
|
DataFrame with earnings calendar data
|
|
372
372
|
"""
|
|
373
|
-
data: dict[str, Any] = {"
|
|
373
|
+
data: dict[str, Any] = {"market": market}
|
|
374
374
|
if start_date:
|
|
375
375
|
data["start_date"] = start_date
|
|
376
376
|
if end_date:
|
|
@@ -397,7 +397,7 @@ class StockModule:
|
|
|
397
397
|
response = self._post("/v1/stock/ipo-calendar-hk", json={"status": status})
|
|
398
398
|
return self._to_dataframe(response)
|
|
399
399
|
|
|
400
|
-
def
|
|
400
|
+
def industry_constituents(
|
|
401
401
|
self,
|
|
402
402
|
market: Literal["cn", "hk", "us"],
|
|
403
403
|
name: str,
|
|
@@ -420,17 +420,59 @@ class StockModule:
|
|
|
420
420
|
|
|
421
421
|
Example:
|
|
422
422
|
>>> # Get CN defense industry stocks
|
|
423
|
-
>>> stocks = client.stock.
|
|
423
|
+
>>> stocks = client.stock.industry_constituents("cn", "军工")
|
|
424
424
|
>>> print(stocks[["symbol", "name", "industry_one_level_name"]])
|
|
425
425
|
|
|
426
426
|
>>> # Get US technology stocks using GICS
|
|
427
|
-
>>> stocks = client.stock.
|
|
427
|
+
>>> stocks = client.stock.industry_constituents("us", "Technology")
|
|
428
428
|
"""
|
|
429
429
|
data = {"market": market, "name": name}
|
|
430
430
|
if type:
|
|
431
431
|
data["type"] = type
|
|
432
432
|
|
|
433
|
-
response = self._post("/v1/stock/industry-
|
|
433
|
+
response = self._post("/v1/stock/industry-constituents", json=data)
|
|
434
|
+
return self._to_dataframe(response)
|
|
435
|
+
|
|
436
|
+
def index_constituents(self, symbol: str) -> pd.DataFrame:
|
|
437
|
+
"""
|
|
438
|
+
Get constituent stocks of an index
|
|
439
|
+
|
|
440
|
+
Args:
|
|
441
|
+
symbol: Index symbol (e.g., "000300" for CSI 300, "399006" for ChiNext)
|
|
442
|
+
|
|
443
|
+
Returns:
|
|
444
|
+
DataFrame with index constituent stocks
|
|
445
|
+
|
|
446
|
+
Example:
|
|
447
|
+
>>> # Get CSI 300 constituent stocks
|
|
448
|
+
>>> stocks = client.stock.index_constituents("000300")
|
|
449
|
+
>>> print(stocks[["market", "symbol"]])
|
|
450
|
+
|
|
451
|
+
>>> # Get ChiNext constituent stocks
|
|
452
|
+
>>> stocks = client.stock.index_constituents("399006")
|
|
453
|
+
"""
|
|
454
|
+
response = self._post("/v1/stock/index-constituents", json={"symbol": symbol})
|
|
455
|
+
return self._to_dataframe(response)
|
|
456
|
+
|
|
457
|
+
def index_funds(self, symbol: str) -> pd.DataFrame:
|
|
458
|
+
"""
|
|
459
|
+
Get tracking funds of an index
|
|
460
|
+
|
|
461
|
+
Args:
|
|
462
|
+
symbol: Index symbol (e.g., "000300" for CSI 300)
|
|
463
|
+
|
|
464
|
+
Returns:
|
|
465
|
+
DataFrame with index tracking funds
|
|
466
|
+
|
|
467
|
+
Example:
|
|
468
|
+
>>> # Get CSI 300 tracking funds
|
|
469
|
+
>>> funds = client.stock.index_funds("000300")
|
|
470
|
+
>>> print(funds[["short_name", "name", "symbol"]])
|
|
471
|
+
|
|
472
|
+
>>> # Get SSE 50 tracking funds
|
|
473
|
+
>>> funds = client.stock.index_funds("000016")
|
|
474
|
+
"""
|
|
475
|
+
response = self._post("/v1/stock/index-tracking-funds", json={"symbol": symbol})
|
|
434
476
|
return self._to_dataframe(response)
|
|
435
477
|
|
|
436
478
|
# -------------------------------------------------------------------------
|
|
@@ -4,10 +4,10 @@ reportify_sdk/docs.py,sha256=O30I1J4qTC8zpkVP_qu1cgT8nv6ysXNClqvaiRb0lhY,4957
|
|
|
4
4
|
reportify_sdk/exceptions.py,sha256=r2_C_kTh6tCrQnfA3UozSqMMA-2OBnoP3pGpgYeqcdU,1049
|
|
5
5
|
reportify_sdk/kb.py,sha256=-4UHWtudFncGRBB42B4YEoMPsEHr4QOtY55_8hKyogE,2240
|
|
6
6
|
reportify_sdk/quant.py,sha256=9rWKWo2UlG3GfsQC-jpEgXUl25ojEabpvOGISyGMamM,15110
|
|
7
|
-
reportify_sdk/stock.py,sha256=
|
|
7
|
+
reportify_sdk/stock.py,sha256=8rJBR86-okwjQnI0n4iwfKaanVSLf1RLjSh8VYxyvOw,16203
|
|
8
8
|
reportify_sdk/timeline.py,sha256=b5Zj5SjXT4gP0dvEl8gXCWDZJHemyU7NSYahet2nHhc,4075
|
|
9
|
-
reportify_sdk-0.2.
|
|
10
|
-
reportify_sdk-0.2.
|
|
11
|
-
reportify_sdk-0.2.
|
|
12
|
-
reportify_sdk-0.2.
|
|
13
|
-
reportify_sdk-0.2.
|
|
9
|
+
reportify_sdk-0.2.5.dist-info/licenses/LICENSE,sha256=zBUq4DL4lE-fZU_PMkr0gnxkYS1LhdRHFw8_LmCb-ek,1066
|
|
10
|
+
reportify_sdk-0.2.5.dist-info/METADATA,sha256=o9kD1myWJldCQ5GEEA_orYwv1oOkjSDFE1yPwaWJHzI,4311
|
|
11
|
+
reportify_sdk-0.2.5.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
12
|
+
reportify_sdk-0.2.5.dist-info/top_level.txt,sha256=tc_dzCSWIDsNbHSi-FlyEEX8xwinhN9gl-CwyLRE4B0,14
|
|
13
|
+
reportify_sdk-0.2.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|