akshare-one 0.3.0__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.
- {akshare_one-0.3.0 → akshare_one-0.3.1}/LICENSE +21 -21
- {akshare_one-0.3.0 → akshare_one-0.3.1}/PKG-INFO +70 -70
- {akshare_one-0.3.0 → akshare_one-0.3.1}/README.md +53 -53
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/__init__.py +31 -31
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/financial.py +46 -46
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/indicators.py +395 -395
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/insider.py +33 -33
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/cache.py +9 -9
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/eastmoney/client.py +88 -88
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/eastmoney/utils.py +104 -104
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/financial/base.py +22 -22
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/financial/factory.py +44 -44
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/financial/sina.py +273 -273
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/historical/base.py +47 -47
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/historical/eastmoney.py +241 -241
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/historical/eastmoney_direct.py +79 -79
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/historical/factory.py +48 -48
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/historical/sina.py +254 -218
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/indicators/base.py +158 -158
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/indicators/factory.py +33 -33
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/indicators/simple.py +230 -230
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/indicators/talib.py +263 -263
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/insider/base.py +28 -28
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/insider/factory.py +44 -44
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/insider/xueqiu.py +115 -115
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/news/base.py +22 -22
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/news/eastmoney.py +47 -47
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/news/factory.py +44 -44
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/realtime/base.py +27 -27
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/realtime/eastmoney.py +57 -57
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/realtime/eastmoney_direct.py +37 -37
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/realtime/factory.py +48 -48
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/realtime/xueqiu.py +60 -60
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/utils.py +10 -10
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/news.py +27 -27
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/stock.py +78 -78
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one.egg-info/PKG-INFO +70 -70
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one.egg-info/requires.txt +1 -1
- {akshare_one-0.3.0 → akshare_one-0.3.1}/pyproject.toml +35 -35
- {akshare_one-0.3.0 → akshare_one-0.3.1}/setup.cfg +4 -4
- {akshare_one-0.3.0 → akshare_one-0.3.1}/tests/test_financial.py +73 -73
- {akshare_one-0.3.0 → akshare_one-0.3.1}/tests/test_indicators.py +331 -331
- {akshare_one-0.3.0 → akshare_one-0.3.1}/tests/test_insider.py +66 -66
- {akshare_one-0.3.0 → akshare_one-0.3.1}/tests/test_news.py +74 -74
- {akshare_one-0.3.0 → akshare_one-0.3.1}/tests/test_stock.py +200 -167
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one/modules/indicators/__init__.py +0 -0
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one.egg-info/SOURCES.txt +0 -0
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one.egg-info/dependency_links.txt +0 -0
- {akshare_one-0.3.0 → akshare_one-0.3.1}/akshare_one.egg-info/top_level.txt +0 -0
@@ -1,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2025 zwldarren
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 zwldarren
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -1,70 +1,70 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: akshare-one
|
3
|
-
Version: 0.3.
|
4
|
-
Summary: Standardized interface for Chinese financial market data, built on AKShare with unified data formats and simplified APIs
|
5
|
-
License-Expression: MIT
|
6
|
-
Project-URL: Homepage, https://github.com/zwldarren/akshare-one
|
7
|
-
Project-URL: Repository, https://github.com/zwldarren/akshare-one.git
|
8
|
-
Keywords: akshare,financial-data,stock-data,quant
|
9
|
-
Requires-Python: >=3.12
|
10
|
-
Description-Content-Type: text/markdown
|
11
|
-
License-File: LICENSE
|
12
|
-
Requires-Dist: akshare>=1.17.
|
13
|
-
Requires-Dist: cachetools>=6.1.0
|
14
|
-
Provides-Extra: talib
|
15
|
-
Requires-Dist: ta-lib>=0.6.4; extra == "talib"
|
16
|
-
Dynamic: license-file
|
17
|
-
|
18
|
-
<div align="center">
|
19
|
-
<h1>AKShare One</h1>
|
20
|
-
<div>
|
21
|
-
<a href="README_zh.md">中文</a> | <strong>English</strong>
|
22
|
-
</div>
|
23
|
-
</div>
|
24
|
-
|
25
|
-
**AKShare One** is a data interface for obtaining Chinese A-shares, based on [AKShare](https://github.com/akfamily/akshare). It aims to simplify AKShare's usage and unify input/output formats from different data sources, making it easier to pass data to LLM.
|
26
|
-
|
27
|
-
## ✨ Features
|
28
|
-
|
29
|
-
- 📊 Unified stock code formats across data sources
|
30
|
-
- 🏗️ Standardized return data structures
|
31
|
-
- 🛠️ Simplified API parameter design
|
32
|
-
- ⏱️ Automatic timestamp and adjustment handling
|
33
|
-
|
34
|
-
## 🚀 Core Features
|
35
|
-
|
36
|
-
| Function | Interface |
|
37
|
-
|------|------|
|
38
|
-
| Historical data | `get_hist_data` |
|
39
|
-
| Real-time quotes | `get_realtime_data` |
|
40
|
-
| Stock news | `get_news_data` |
|
41
|
-
| Financial data | `get_balance_sheet`/`get_income_statement`/`get_cash_flow` |
|
42
|
-
| Internal transactions | `get_inner_trade_data` |
|
43
|
-
| Technical indicators | See [indicators.py](akshare_one/indicators.py) |
|
44
|
-
|
45
|
-
## 📦 Quick Installation
|
46
|
-
|
47
|
-
```bash
|
48
|
-
pip install akshare-one
|
49
|
-
```
|
50
|
-
|
51
|
-
## 💻 Usage Example
|
52
|
-
|
53
|
-
```python
|
54
|
-
from akshare_one import get_hist_data
|
55
|
-
from akshare_one.indicators import get_sma
|
56
|
-
|
57
|
-
# Get historical data
|
58
|
-
df = get_hist_data(
|
59
|
-
symbol="600000",
|
60
|
-
interval="day",
|
61
|
-
adjust="hfq"
|
62
|
-
)
|
63
|
-
|
64
|
-
# Calculate 20-day Simple Moving Average
|
65
|
-
df_sma = get_sma(df, window=20)
|
66
|
-
```
|
67
|
-
|
68
|
-
## 📚 Documentation
|
69
|
-
|
70
|
-
Detailed API reference: [docs/api.md](docs/api.md)
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: akshare-one
|
3
|
+
Version: 0.3.1
|
4
|
+
Summary: Standardized interface for Chinese financial market data, built on AKShare with unified data formats and simplified APIs
|
5
|
+
License-Expression: MIT
|
6
|
+
Project-URL: Homepage, https://github.com/zwldarren/akshare-one
|
7
|
+
Project-URL: Repository, https://github.com/zwldarren/akshare-one.git
|
8
|
+
Keywords: akshare,financial-data,stock-data,quant
|
9
|
+
Requires-Python: >=3.12
|
10
|
+
Description-Content-Type: text/markdown
|
11
|
+
License-File: LICENSE
|
12
|
+
Requires-Dist: akshare>=1.17.15
|
13
|
+
Requires-Dist: cachetools>=6.1.0
|
14
|
+
Provides-Extra: talib
|
15
|
+
Requires-Dist: ta-lib>=0.6.4; extra == "talib"
|
16
|
+
Dynamic: license-file
|
17
|
+
|
18
|
+
<div align="center">
|
19
|
+
<h1>AKShare One</h1>
|
20
|
+
<div>
|
21
|
+
<a href="README_zh.md">中文</a> | <strong>English</strong>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
**AKShare One** is a data interface for obtaining Chinese A-shares, based on [AKShare](https://github.com/akfamily/akshare). It aims to simplify AKShare's usage and unify input/output formats from different data sources, making it easier to pass data to LLM.
|
26
|
+
|
27
|
+
## ✨ Features
|
28
|
+
|
29
|
+
- 📊 Unified stock code formats across data sources
|
30
|
+
- 🏗️ Standardized return data structures
|
31
|
+
- 🛠️ Simplified API parameter design
|
32
|
+
- ⏱️ Automatic timestamp and adjustment handling
|
33
|
+
|
34
|
+
## 🚀 Core Features
|
35
|
+
|
36
|
+
| Function | Interface |
|
37
|
+
|------|------|
|
38
|
+
| Historical data | `get_hist_data` |
|
39
|
+
| Real-time quotes | `get_realtime_data` |
|
40
|
+
| Stock news | `get_news_data` |
|
41
|
+
| Financial data | `get_balance_sheet`/`get_income_statement`/`get_cash_flow` |
|
42
|
+
| Internal transactions | `get_inner_trade_data` |
|
43
|
+
| Technical indicators | See [indicators.py](akshare_one/indicators.py) |
|
44
|
+
|
45
|
+
## 📦 Quick Installation
|
46
|
+
|
47
|
+
```bash
|
48
|
+
pip install akshare-one
|
49
|
+
```
|
50
|
+
|
51
|
+
## 💻 Usage Example
|
52
|
+
|
53
|
+
```python
|
54
|
+
from akshare_one import get_hist_data
|
55
|
+
from akshare_one.indicators import get_sma
|
56
|
+
|
57
|
+
# Get historical data
|
58
|
+
df = get_hist_data(
|
59
|
+
symbol="600000",
|
60
|
+
interval="day",
|
61
|
+
adjust="hfq"
|
62
|
+
)
|
63
|
+
|
64
|
+
# Calculate 20-day Simple Moving Average
|
65
|
+
df_sma = get_sma(df, window=20)
|
66
|
+
```
|
67
|
+
|
68
|
+
## 📚 Documentation
|
69
|
+
|
70
|
+
Detailed API reference: [docs/api.md](docs/api.md)
|
@@ -1,53 +1,53 @@
|
|
1
|
-
<div align="center">
|
2
|
-
<h1>AKShare One</h1>
|
3
|
-
<div>
|
4
|
-
<a href="README_zh.md">中文</a> | <strong>English</strong>
|
5
|
-
</div>
|
6
|
-
</div>
|
7
|
-
|
8
|
-
**AKShare One** is a data interface for obtaining Chinese A-shares, based on [AKShare](https://github.com/akfamily/akshare). It aims to simplify AKShare's usage and unify input/output formats from different data sources, making it easier to pass data to LLM.
|
9
|
-
|
10
|
-
## ✨ Features
|
11
|
-
|
12
|
-
- 📊 Unified stock code formats across data sources
|
13
|
-
- 🏗️ Standardized return data structures
|
14
|
-
- 🛠️ Simplified API parameter design
|
15
|
-
- ⏱️ Automatic timestamp and adjustment handling
|
16
|
-
|
17
|
-
## 🚀 Core Features
|
18
|
-
|
19
|
-
| Function | Interface |
|
20
|
-
|------|------|
|
21
|
-
| Historical data | `get_hist_data` |
|
22
|
-
| Real-time quotes | `get_realtime_data` |
|
23
|
-
| Stock news | `get_news_data` |
|
24
|
-
| Financial data | `get_balance_sheet`/`get_income_statement`/`get_cash_flow` |
|
25
|
-
| Internal transactions | `get_inner_trade_data` |
|
26
|
-
| Technical indicators | See [indicators.py](akshare_one/indicators.py) |
|
27
|
-
|
28
|
-
## 📦 Quick Installation
|
29
|
-
|
30
|
-
```bash
|
31
|
-
pip install akshare-one
|
32
|
-
```
|
33
|
-
|
34
|
-
## 💻 Usage Example
|
35
|
-
|
36
|
-
```python
|
37
|
-
from akshare_one import get_hist_data
|
38
|
-
from akshare_one.indicators import get_sma
|
39
|
-
|
40
|
-
# Get historical data
|
41
|
-
df = get_hist_data(
|
42
|
-
symbol="600000",
|
43
|
-
interval="day",
|
44
|
-
adjust="hfq"
|
45
|
-
)
|
46
|
-
|
47
|
-
# Calculate 20-day Simple Moving Average
|
48
|
-
df_sma = get_sma(df, window=20)
|
49
|
-
```
|
50
|
-
|
51
|
-
## 📚 Documentation
|
52
|
-
|
53
|
-
Detailed API reference: [docs/api.md](docs/api.md)
|
1
|
+
<div align="center">
|
2
|
+
<h1>AKShare One</h1>
|
3
|
+
<div>
|
4
|
+
<a href="README_zh.md">中文</a> | <strong>English</strong>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
**AKShare One** is a data interface for obtaining Chinese A-shares, based on [AKShare](https://github.com/akfamily/akshare). It aims to simplify AKShare's usage and unify input/output formats from different data sources, making it easier to pass data to LLM.
|
9
|
+
|
10
|
+
## ✨ Features
|
11
|
+
|
12
|
+
- 📊 Unified stock code formats across data sources
|
13
|
+
- 🏗️ Standardized return data structures
|
14
|
+
- 🛠️ Simplified API parameter design
|
15
|
+
- ⏱️ Automatic timestamp and adjustment handling
|
16
|
+
|
17
|
+
## 🚀 Core Features
|
18
|
+
|
19
|
+
| Function | Interface |
|
20
|
+
|------|------|
|
21
|
+
| Historical data | `get_hist_data` |
|
22
|
+
| Real-time quotes | `get_realtime_data` |
|
23
|
+
| Stock news | `get_news_data` |
|
24
|
+
| Financial data | `get_balance_sheet`/`get_income_statement`/`get_cash_flow` |
|
25
|
+
| Internal transactions | `get_inner_trade_data` |
|
26
|
+
| Technical indicators | See [indicators.py](akshare_one/indicators.py) |
|
27
|
+
|
28
|
+
## 📦 Quick Installation
|
29
|
+
|
30
|
+
```bash
|
31
|
+
pip install akshare-one
|
32
|
+
```
|
33
|
+
|
34
|
+
## 💻 Usage Example
|
35
|
+
|
36
|
+
```python
|
37
|
+
from akshare_one import get_hist_data
|
38
|
+
from akshare_one.indicators import get_sma
|
39
|
+
|
40
|
+
# Get historical data
|
41
|
+
df = get_hist_data(
|
42
|
+
symbol="600000",
|
43
|
+
interval="day",
|
44
|
+
adjust="hfq"
|
45
|
+
)
|
46
|
+
|
47
|
+
# Calculate 20-day Simple Moving Average
|
48
|
+
df_sma = get_sma(df, window=20)
|
49
|
+
```
|
50
|
+
|
51
|
+
## 📚 Documentation
|
52
|
+
|
53
|
+
Detailed API reference: [docs/api.md](docs/api.md)
|
@@ -1,31 +1,31 @@
|
|
1
|
-
"""Akshare One - Unified interface for Chinese market data
|
2
|
-
|
3
|
-
Provides standardized access to various financial data sources with:
|
4
|
-
- Consistent symbol formats
|
5
|
-
- Unified data schemas
|
6
|
-
- Cleaned and normalized outputs
|
7
|
-
|
8
|
-
Example:
|
9
|
-
>>> from akshare_one import get_hist_data, get_realtime_data
|
10
|
-
>>> # 获取股票历史数据
|
11
|
-
>>> df = get_hist_data("600000", interval="day")
|
12
|
-
>>> print(df.head())
|
13
|
-
>>> # 获取股票实时数据
|
14
|
-
>>> df = get_realtime_data(symbol="600000")
|
15
|
-
"""
|
16
|
-
|
17
|
-
from .stock import get_hist_data, get_realtime_data
|
18
|
-
from .news import get_news_data
|
19
|
-
from .insider import get_inner_trade_data
|
20
|
-
from .financial import get_balance_sheet, get_income_statement, get_cash_flow
|
21
|
-
|
22
|
-
|
23
|
-
__all__ = [
|
24
|
-
"get_hist_data",
|
25
|
-
"get_realtime_data",
|
26
|
-
"get_news_data",
|
27
|
-
"get_inner_trade_data",
|
28
|
-
"get_balance_sheet",
|
29
|
-
"get_income_statement",
|
30
|
-
"get_cash_flow",
|
31
|
-
]
|
1
|
+
"""Akshare One - Unified interface for Chinese market data
|
2
|
+
|
3
|
+
Provides standardized access to various financial data sources with:
|
4
|
+
- Consistent symbol formats
|
5
|
+
- Unified data schemas
|
6
|
+
- Cleaned and normalized outputs
|
7
|
+
|
8
|
+
Example:
|
9
|
+
>>> from akshare_one import get_hist_data, get_realtime_data
|
10
|
+
>>> # 获取股票历史数据
|
11
|
+
>>> df = get_hist_data("600000", interval="day")
|
12
|
+
>>> print(df.head())
|
13
|
+
>>> # 获取股票实时数据
|
14
|
+
>>> df = get_realtime_data(symbol="600000")
|
15
|
+
"""
|
16
|
+
|
17
|
+
from .stock import get_hist_data, get_realtime_data
|
18
|
+
from .news import get_news_data
|
19
|
+
from .insider import get_inner_trade_data
|
20
|
+
from .financial import get_balance_sheet, get_income_statement, get_cash_flow
|
21
|
+
|
22
|
+
|
23
|
+
__all__ = [
|
24
|
+
"get_hist_data",
|
25
|
+
"get_realtime_data",
|
26
|
+
"get_news_data",
|
27
|
+
"get_inner_trade_data",
|
28
|
+
"get_balance_sheet",
|
29
|
+
"get_income_statement",
|
30
|
+
"get_cash_flow",
|
31
|
+
]
|
@@ -1,46 +1,46 @@
|
|
1
|
-
"""财务报表数据模块
|
2
|
-
|
3
|
-
包含资产负债表、利润表和现金流量表相关功能
|
4
|
-
"""
|
5
|
-
|
6
|
-
import pandas as pd
|
7
|
-
from akshare_one.modules.financial.factory import FinancialDataFactory
|
8
|
-
|
9
|
-
|
10
|
-
def get_balance_sheet(symbol: str, source: str = "sina") -> "pd.DataFrame":
|
11
|
-
"""获取资产负债表数据
|
12
|
-
|
13
|
-
Args:
|
14
|
-
symbol: 股票代码 (如 "600600")
|
15
|
-
source: 数据源 ("sina")
|
16
|
-
"""
|
17
|
-
if source == "sina":
|
18
|
-
provider = FinancialDataFactory.get_provider(source, symbol=symbol)
|
19
|
-
return provider.get_balance_sheet()
|
20
|
-
raise ValueError(f"Unsupported data source: {source}")
|
21
|
-
|
22
|
-
|
23
|
-
def get_income_statement(symbol: str, source: str = "sina") -> "pd.DataFrame":
|
24
|
-
"""获取利润表数据
|
25
|
-
|
26
|
-
Args:
|
27
|
-
symbol: 股票代码 (如 "600600")
|
28
|
-
source: 数据源 ("sina")
|
29
|
-
"""
|
30
|
-
if source == "sina":
|
31
|
-
provider = FinancialDataFactory.get_provider(source, symbol=symbol)
|
32
|
-
return provider.get_income_statement()
|
33
|
-
raise ValueError(f"Unsupported data source: {source}")
|
34
|
-
|
35
|
-
|
36
|
-
def get_cash_flow(symbol: str, source: str = "sina") -> "pd.DataFrame":
|
37
|
-
"""获取现金流量表数据
|
38
|
-
|
39
|
-
Args:
|
40
|
-
symbol: 股票代码 (如 "600600")
|
41
|
-
source: 数据源 ("sina")
|
42
|
-
"""
|
43
|
-
if source == "sina":
|
44
|
-
provider = FinancialDataFactory.get_provider(source, symbol=symbol)
|
45
|
-
return provider.get_cash_flow()
|
46
|
-
raise ValueError(f"Unsupported data source: {source}")
|
1
|
+
"""财务报表数据模块
|
2
|
+
|
3
|
+
包含资产负债表、利润表和现金流量表相关功能
|
4
|
+
"""
|
5
|
+
|
6
|
+
import pandas as pd
|
7
|
+
from akshare_one.modules.financial.factory import FinancialDataFactory
|
8
|
+
|
9
|
+
|
10
|
+
def get_balance_sheet(symbol: str, source: str = "sina") -> "pd.DataFrame":
|
11
|
+
"""获取资产负债表数据
|
12
|
+
|
13
|
+
Args:
|
14
|
+
symbol: 股票代码 (如 "600600")
|
15
|
+
source: 数据源 ("sina")
|
16
|
+
"""
|
17
|
+
if source == "sina":
|
18
|
+
provider = FinancialDataFactory.get_provider(source, symbol=symbol)
|
19
|
+
return provider.get_balance_sheet()
|
20
|
+
raise ValueError(f"Unsupported data source: {source}")
|
21
|
+
|
22
|
+
|
23
|
+
def get_income_statement(symbol: str, source: str = "sina") -> "pd.DataFrame":
|
24
|
+
"""获取利润表数据
|
25
|
+
|
26
|
+
Args:
|
27
|
+
symbol: 股票代码 (如 "600600")
|
28
|
+
source: 数据源 ("sina")
|
29
|
+
"""
|
30
|
+
if source == "sina":
|
31
|
+
provider = FinancialDataFactory.get_provider(source, symbol=symbol)
|
32
|
+
return provider.get_income_statement()
|
33
|
+
raise ValueError(f"Unsupported data source: {source}")
|
34
|
+
|
35
|
+
|
36
|
+
def get_cash_flow(symbol: str, source: str = "sina") -> "pd.DataFrame":
|
37
|
+
"""获取现金流量表数据
|
38
|
+
|
39
|
+
Args:
|
40
|
+
symbol: 股票代码 (如 "600600")
|
41
|
+
source: 数据源 ("sina")
|
42
|
+
"""
|
43
|
+
if source == "sina":
|
44
|
+
provider = FinancialDataFactory.get_provider(source, symbol=symbol)
|
45
|
+
return provider.get_cash_flow()
|
46
|
+
raise ValueError(f"Unsupported data source: {source}")
|