reportify-sdk 0.2.5__py3-none-any.whl → 0.2.7__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/client.py +10 -1
- reportify_sdk/concepts.py +64 -0
- reportify_sdk/stock.py +3 -3
- {reportify_sdk-0.2.5.dist-info → reportify_sdk-0.2.7.dist-info}/METADATA +1 -1
- {reportify_sdk-0.2.5.dist-info → reportify_sdk-0.2.7.dist-info}/RECORD +8 -7
- {reportify_sdk-0.2.5.dist-info → reportify_sdk-0.2.7.dist-info}/WHEEL +0 -0
- {reportify_sdk-0.2.5.dist-info → reportify_sdk-0.2.7.dist-info}/licenses/LICENSE +0 -0
- {reportify_sdk-0.2.5.dist-info → reportify_sdk-0.2.7.dist-info}/top_level.txt +0 -0
reportify_sdk/client.py
CHANGED
|
@@ -62,13 +62,14 @@ class Reportify:
|
|
|
62
62
|
self._docs = None
|
|
63
63
|
self._tools = None
|
|
64
64
|
self._quant = None
|
|
65
|
+
self._concepts = None
|
|
65
66
|
|
|
66
67
|
def _get_headers(self) -> dict[str, str]:
|
|
67
68
|
"""Get default headers for API requests"""
|
|
68
69
|
return {
|
|
69
70
|
"Authorization": f"Bearer {self.api_key}",
|
|
70
71
|
"Content-Type": "application/json",
|
|
71
|
-
"User-Agent": "reportify-sdk-python/0.
|
|
72
|
+
"User-Agent": "reportify-sdk-python/0.2.7",
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
def _request(
|
|
@@ -360,6 +361,14 @@ class Reportify:
|
|
|
360
361
|
self._quant = QuantModule(self)
|
|
361
362
|
return self._quant
|
|
362
363
|
|
|
364
|
+
@property
|
|
365
|
+
def concepts(self):
|
|
366
|
+
"""Concepts module for accessing concept data and feeds"""
|
|
367
|
+
if self._concepts is None:
|
|
368
|
+
from reportify_sdk.concepts import ConceptsModule
|
|
369
|
+
self._concepts = ConceptsModule(self)
|
|
370
|
+
return self._concepts
|
|
371
|
+
|
|
363
372
|
def close(self):
|
|
364
373
|
"""Close the HTTP client"""
|
|
365
374
|
self._client.close()
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Concepts Module
|
|
3
|
+
|
|
4
|
+
Provides access to concept-related data and feeds.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from reportify_sdk.client import Reportify
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ConceptsModule:
|
|
13
|
+
"""
|
|
14
|
+
Concepts module for accessing concept data and feeds
|
|
15
|
+
|
|
16
|
+
This module provides methods to:
|
|
17
|
+
- Get latest concepts
|
|
18
|
+
- Get today's concept feeds
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __init__(self, client: Reportify):
|
|
22
|
+
self.client = client
|
|
23
|
+
|
|
24
|
+
def _get(self, path: str, params: dict[str, Any] | None = None) -> dict[str, Any]:
|
|
25
|
+
"""Helper method for GET requests"""
|
|
26
|
+
return self.client._get(path, params)
|
|
27
|
+
|
|
28
|
+
def latest(self, include_docs: bool = True) -> list[dict[str, Any]]:
|
|
29
|
+
"""
|
|
30
|
+
Get latest concepts
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
include_docs: Whether to include related documents (default: True)
|
|
34
|
+
|
|
35
|
+
Returns:
|
|
36
|
+
List of latest concepts with stocks, keywords, and events
|
|
37
|
+
|
|
38
|
+
Example:
|
|
39
|
+
>>> # Get latest concepts
|
|
40
|
+
>>> concepts = client.concepts.latest()
|
|
41
|
+
>>> for concept in concepts:
|
|
42
|
+
... print(concept['concept_name'])
|
|
43
|
+
|
|
44
|
+
>>> # Get concepts without documents
|
|
45
|
+
>>> concepts = client.concepts.latest(include_docs=False)
|
|
46
|
+
"""
|
|
47
|
+
params = {"include_docs": include_docs}
|
|
48
|
+
return self._get("/v1/concepts/latest", params)
|
|
49
|
+
|
|
50
|
+
def today(self) -> list[dict[str, Any]]:
|
|
51
|
+
"""
|
|
52
|
+
Get today's concept feeds
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
List of today's concept feeds with events, stocks, and docs
|
|
56
|
+
|
|
57
|
+
Example:
|
|
58
|
+
>>> # Get today's concept feeds
|
|
59
|
+
>>> feeds = client.concepts.today()
|
|
60
|
+
>>> for feed in feeds:
|
|
61
|
+
... print(f"{feed['concept_name']}: {feed['gen_count']} generations")
|
|
62
|
+
... print(f"Time range: {feed['earliest_at']} - {feed['latest_at']}")
|
|
63
|
+
"""
|
|
64
|
+
return self._get("/v1/concepts/today")
|
reportify_sdk/stock.py
CHANGED
|
@@ -454,7 +454,7 @@ class StockModule:
|
|
|
454
454
|
response = self._post("/v1/stock/index-constituents", json={"symbol": symbol})
|
|
455
455
|
return self._to_dataframe(response)
|
|
456
456
|
|
|
457
|
-
def
|
|
457
|
+
def index_tracking_funds(self, symbol: str) -> pd.DataFrame:
|
|
458
458
|
"""
|
|
459
459
|
Get tracking funds of an index
|
|
460
460
|
|
|
@@ -466,11 +466,11 @@ class StockModule:
|
|
|
466
466
|
|
|
467
467
|
Example:
|
|
468
468
|
>>> # Get CSI 300 tracking funds
|
|
469
|
-
>>> funds = client.stock.
|
|
469
|
+
>>> funds = client.stock.index_tracking_funds("000300")
|
|
470
470
|
>>> print(funds[["short_name", "name", "symbol"]])
|
|
471
471
|
|
|
472
472
|
>>> # Get SSE 50 tracking funds
|
|
473
|
-
>>> funds = client.stock.
|
|
473
|
+
>>> funds = client.stock.index_tracking_funds("000016")
|
|
474
474
|
"""
|
|
475
475
|
response = self._post("/v1/stock/index-tracking-funds", json={"symbol": symbol})
|
|
476
476
|
return self._to_dataframe(response)
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
reportify_sdk/__init__.py,sha256=f2bq8Exeuf5g7hAhEQ3qrS7wMVqZRXP7xmQEYA3Nvso,662
|
|
2
|
-
reportify_sdk/client.py,sha256=
|
|
2
|
+
reportify_sdk/client.py,sha256=V66J_IH3qq9VPxbiQcB0tyRzg3iWjS0nYA-XS_KcSg8,11332
|
|
3
|
+
reportify_sdk/concepts.py,sha256=XlHPuuZacFFUccMthyeb5R2OTayFYxXgIODKNfJLa_c,1891
|
|
3
4
|
reportify_sdk/docs.py,sha256=O30I1J4qTC8zpkVP_qu1cgT8nv6ysXNClqvaiRb0lhY,4957
|
|
4
5
|
reportify_sdk/exceptions.py,sha256=r2_C_kTh6tCrQnfA3UozSqMMA-2OBnoP3pGpgYeqcdU,1049
|
|
5
6
|
reportify_sdk/kb.py,sha256=-4UHWtudFncGRBB42B4YEoMPsEHr4QOtY55_8hKyogE,2240
|
|
6
7
|
reportify_sdk/quant.py,sha256=9rWKWo2UlG3GfsQC-jpEgXUl25ojEabpvOGISyGMamM,15110
|
|
7
|
-
reportify_sdk/stock.py,sha256=
|
|
8
|
+
reportify_sdk/stock.py,sha256=MHrWt7L1_xanhplmfYoGJszQqKcFF7VJVD_sgfEsny0,16230
|
|
8
9
|
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.
|
|
10
|
+
reportify_sdk-0.2.7.dist-info/licenses/LICENSE,sha256=zBUq4DL4lE-fZU_PMkr0gnxkYS1LhdRHFw8_LmCb-ek,1066
|
|
11
|
+
reportify_sdk-0.2.7.dist-info/METADATA,sha256=gfjpqCZXPHFAGAHKQSPUZzlECUCV4ZY91Qg74Hdhco8,4311
|
|
12
|
+
reportify_sdk-0.2.7.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
13
|
+
reportify_sdk-0.2.7.dist-info/top_level.txt,sha256=tc_dzCSWIDsNbHSi-FlyEEX8xwinhN9gl-CwyLRE4B0,14
|
|
14
|
+
reportify_sdk-0.2.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|