akshare-one 0.3.1__py3-none-any.whl → 0.3.3__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.
- akshare_one/__init__.py +214 -31
- akshare_one/indicators.py +395 -395
- akshare_one/modules/cache.py +10 -9
- akshare_one/modules/eastmoney/client.py +88 -88
- akshare_one/modules/eastmoney/utils.py +104 -104
- akshare_one/modules/financial/base.py +27 -22
- akshare_one/modules/financial/eastmoney.py +184 -0
- akshare_one/modules/financial/factory.py +46 -44
- akshare_one/modules/financial/sina.py +298 -273
- akshare_one/modules/historical/base.py +47 -47
- akshare_one/modules/historical/eastmoney.py +241 -241
- akshare_one/modules/historical/eastmoney_direct.py +79 -79
- akshare_one/modules/historical/factory.py +48 -48
- akshare_one/modules/historical/sina.py +254 -254
- akshare_one/modules/indicators/base.py +158 -158
- akshare_one/modules/indicators/factory.py +33 -33
- akshare_one/modules/indicators/simple.py +230 -230
- akshare_one/modules/indicators/talib.py +263 -263
- akshare_one/modules/info/base.py +25 -0
- akshare_one/modules/info/eastmoney.py +52 -0
- akshare_one/modules/info/factory.py +44 -0
- akshare_one/modules/insider/base.py +28 -28
- akshare_one/modules/insider/factory.py +44 -44
- akshare_one/modules/insider/xueqiu.py +115 -115
- akshare_one/modules/news/base.py +22 -22
- akshare_one/modules/news/eastmoney.py +47 -47
- akshare_one/modules/news/factory.py +44 -44
- akshare_one/modules/realtime/base.py +27 -27
- akshare_one/modules/realtime/eastmoney.py +57 -57
- akshare_one/modules/realtime/eastmoney_direct.py +37 -37
- akshare_one/modules/realtime/factory.py +48 -48
- akshare_one/modules/realtime/xueqiu.py +60 -60
- akshare_one/modules/utils.py +10 -10
- {akshare_one-0.3.1.dist-info → akshare_one-0.3.3.dist-info}/METADATA +70 -70
- akshare_one-0.3.3.dist-info/RECORD +39 -0
- {akshare_one-0.3.1.dist-info → akshare_one-0.3.3.dist-info}/licenses/LICENSE +21 -21
- akshare_one/financial.py +0 -46
- akshare_one/insider.py +0 -33
- akshare_one/news.py +0 -27
- akshare_one/stock.py +0 -78
- akshare_one-0.3.1.dist-info/RECORD +0 -39
- {akshare_one-0.3.1.dist-info → akshare_one-0.3.3.dist-info}/WHEEL +0 -0
- {akshare_one-0.3.1.dist-info → akshare_one-0.3.3.dist-info}/top_level.txt +0 -0
@@ -1,44 +1,46 @@
|
|
1
|
-
from .
|
2
|
-
from .
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
1
|
+
from .eastmoney import EastMoneyFinancialReport
|
2
|
+
from .sina import SinaFinancialReport
|
3
|
+
from .base import FinancialDataProvider
|
4
|
+
|
5
|
+
|
6
|
+
class FinancialDataFactory:
|
7
|
+
"""
|
8
|
+
Factory class for creating financial data providers
|
9
|
+
"""
|
10
|
+
|
11
|
+
_providers = {
|
12
|
+
"sina": SinaFinancialReport,
|
13
|
+
"eastmoney": EastMoneyFinancialReport,
|
14
|
+
}
|
15
|
+
|
16
|
+
@classmethod
|
17
|
+
def get_provider(cls, provider_name: str, **kwargs) -> FinancialDataProvider:
|
18
|
+
"""
|
19
|
+
Get a financial data provider by name
|
20
|
+
|
21
|
+
Args:
|
22
|
+
provider_name: Name of the provider (e.g., 'sina')
|
23
|
+
**kwargs: Additional arguments to pass to the provider's constructor
|
24
|
+
|
25
|
+
Returns:
|
26
|
+
FinancialDataProvider: An instance of the requested provider
|
27
|
+
|
28
|
+
Raises:
|
29
|
+
ValueError: If the requested provider is not found
|
30
|
+
"""
|
31
|
+
provider_class = cls._providers.get(provider_name.lower())
|
32
|
+
if not provider_class:
|
33
|
+
raise ValueError(f"Unknown financial data provider: {provider_name}")
|
34
|
+
|
35
|
+
return provider_class(**kwargs)
|
36
|
+
|
37
|
+
@classmethod
|
38
|
+
def register_provider(cls, name: str, provider_class: type):
|
39
|
+
"""
|
40
|
+
Register a new financial data provider
|
41
|
+
|
42
|
+
Args:
|
43
|
+
name: Name to associate with this provider
|
44
|
+
provider_class: The provider class to register
|
45
|
+
"""
|
46
|
+
cls._providers[name.lower()] = provider_class
|