lixinger-python 0.3.7__py3-none-any.whl → 0.3.8__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.
- lixinger/__init__.py +11 -1
- lixinger/api/cn/company/fs/__init__.py +44 -3
- lixinger/api/cn/company/fs/bank.py +132 -0
- lixinger/api/cn/company/fs/insurance.py +132 -0
- lixinger/api/cn/company/fs/non_financial.py +8 -2
- lixinger/api/cn/company/fs/other_financial.py +131 -0
- lixinger/api/cn/company/fs/security.py +132 -0
- lixinger/api/cn/company/namespace.py +46 -4
- lixinger/client.py +16 -0
- lixinger/models/cn/company/fs/__init__.py +11 -1
- lixinger/models/cn/company/fs/bank.py +20 -0
- lixinger/models/cn/company/fs/insurance.py +20 -0
- lixinger/models/cn/company/fs/other_financial.py +20 -0
- lixinger/models/cn/company/fs/security.py +20 -0
- {lixinger_python-0.3.7.dist-info → lixinger_python-0.3.8.dist-info}/METADATA +1 -1
- {lixinger_python-0.3.7.dist-info → lixinger_python-0.3.8.dist-info}/RECORD +18 -10
- {lixinger_python-0.3.7.dist-info → lixinger_python-0.3.8.dist-info}/WHEEL +0 -0
- {lixinger_python-0.3.7.dist-info → lixinger_python-0.3.8.dist-info}/licenses/LICENSE +0 -0
lixinger/__init__.py
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
from lixinger.api.cn.company import get_company, get_equity_change, get_profile
|
|
2
2
|
from lixinger.api.cn.company.candlestick import get_candlestick
|
|
3
|
-
from lixinger.api.cn.company.fs
|
|
3
|
+
from lixinger.api.cn.company.fs import (
|
|
4
|
+
get_bank_statements,
|
|
5
|
+
get_insurance_statements,
|
|
6
|
+
get_non_financial_statements,
|
|
7
|
+
get_other_financial_statements,
|
|
8
|
+
get_security_statements,
|
|
9
|
+
)
|
|
4
10
|
from lixinger.api.cn.company.fundamental import (
|
|
5
11
|
get_bank_fundamental,
|
|
6
12
|
get_insurance_fundamental,
|
|
@@ -73,6 +79,10 @@ __all__ = [
|
|
|
73
79
|
"get_index_candlestick",
|
|
74
80
|
"get_index_drawdown",
|
|
75
81
|
"get_non_financial_statements",
|
|
82
|
+
"get_bank_statements",
|
|
83
|
+
"get_insurance_statements",
|
|
84
|
+
"get_security_statements",
|
|
85
|
+
"get_other_financial_statements",
|
|
76
86
|
"get_non_financial_fundamental",
|
|
77
87
|
"get_bank_fundamental",
|
|
78
88
|
"get_insurance_fundamental",
|
|
@@ -1,5 +1,46 @@
|
|
|
1
|
-
"""Financial statement APIs.
|
|
1
|
+
"""Financial statement APIs.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This module provides access to company financial statement APIs by company type:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- non_financial: Non-financial companies (非金融企业)
|
|
6
|
+
- bank: Banks (银行)
|
|
7
|
+
- insurance: Insurance companies (保险)
|
|
8
|
+
- security: Securities companies (证券)
|
|
9
|
+
- other_financial: Other financial companies (租赁、消费金融等)
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from lixinger.api.cn.company.fs.bank import (
|
|
13
|
+
BankStatementAPI,
|
|
14
|
+
get_bank_statements,
|
|
15
|
+
)
|
|
16
|
+
from lixinger.api.cn.company.fs.insurance import (
|
|
17
|
+
InsuranceStatementAPI,
|
|
18
|
+
get_insurance_statements,
|
|
19
|
+
)
|
|
20
|
+
from lixinger.api.cn.company.fs.non_financial import (
|
|
21
|
+
NonFinancialStatementAPI,
|
|
22
|
+
get_non_financial_statements,
|
|
23
|
+
)
|
|
24
|
+
from lixinger.api.cn.company.fs.other_financial import (
|
|
25
|
+
OtherFinancialStatementAPI,
|
|
26
|
+
get_other_financial_statements,
|
|
27
|
+
)
|
|
28
|
+
from lixinger.api.cn.company.fs.security import (
|
|
29
|
+
SecurityStatementAPI,
|
|
30
|
+
get_security_statements,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
__all__ = [
|
|
34
|
+
# API Classes
|
|
35
|
+
"BankStatementAPI",
|
|
36
|
+
"InsuranceStatementAPI",
|
|
37
|
+
"NonFinancialStatementAPI",
|
|
38
|
+
"OtherFinancialStatementAPI",
|
|
39
|
+
"SecurityStatementAPI",
|
|
40
|
+
# Functional APIs
|
|
41
|
+
"get_bank_statements",
|
|
42
|
+
"get_insurance_statements",
|
|
43
|
+
"get_non_financial_statements",
|
|
44
|
+
"get_other_financial_statements",
|
|
45
|
+
"get_security_statements",
|
|
46
|
+
]
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"""Bank financial statement APIs."""
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
import pandas as pd
|
|
6
|
+
|
|
7
|
+
from lixinger.api.base import BaseAPI
|
|
8
|
+
from lixinger.models.cn.company.fs.bank import BankStatementSchema
|
|
9
|
+
from lixinger.utils.api import api
|
|
10
|
+
from lixinger.utils.dataframe import get_response_df
|
|
11
|
+
from lixinger.utils.dict import flatten_dict
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class BankStatementAPI(BaseAPI):
|
|
15
|
+
"""Bank financial statement APIs."""
|
|
16
|
+
|
|
17
|
+
async def get_bank_statements( # noqa: PLR0913
|
|
18
|
+
self,
|
|
19
|
+
stock_codes: list[str],
|
|
20
|
+
metrics: list[str],
|
|
21
|
+
date: str | None = None,
|
|
22
|
+
start_date: str | None = None,
|
|
23
|
+
end_date: str | None = None,
|
|
24
|
+
limit: int | None = None,
|
|
25
|
+
) -> pd.DataFrame:
|
|
26
|
+
"""获取A股上市银行的财务报表数据.
|
|
27
|
+
|
|
28
|
+
API Endpoint: /cn/company/fs/bank
|
|
29
|
+
API Method: POST
|
|
30
|
+
API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/company/fs/bank
|
|
31
|
+
|
|
32
|
+
获取A股上市银行的财务报表数据,包括利润表、资产负债表、现金流量表、
|
|
33
|
+
正常财务指标以及银行特有财务指标(净息差、净利差、资本充足率、
|
|
34
|
+
不良率、拨贷比等)。
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
stock_codes: 股票代码列表,长度 >=1 且 <=100。当传入 start_date
|
|
38
|
+
时只能传入一个股票代码。
|
|
39
|
+
metrics: 指标列表,格式为
|
|
40
|
+
``[granularity].[tableName].[fieldName].[expressionCalculateType]``,
|
|
41
|
+
例如 ``"q.ps.oi.t"``。当 stock_codes 长度大于 1 时最多 48 个
|
|
42
|
+
指标;等于 1 时最多 128 个指标。
|
|
43
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
|
|
44
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
45
|
+
end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
|
|
46
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
包含A股银行财务报表数据的 DataFrame。
|
|
50
|
+
|
|
51
|
+
Example:
|
|
52
|
+
获取民生银行和工商银行的营业收入::
|
|
53
|
+
|
|
54
|
+
from lixinger import AsyncLixingerClient
|
|
55
|
+
|
|
56
|
+
async with AsyncLixingerClient() as client:
|
|
57
|
+
df = await client.cn_company.fs.bank.get_bank_statements(
|
|
58
|
+
stock_codes=["600016", "601398"],
|
|
59
|
+
metrics=["q.ps.oi.t"],
|
|
60
|
+
date="2026-03-31",
|
|
61
|
+
)
|
|
62
|
+
print(df)
|
|
63
|
+
|
|
64
|
+
"""
|
|
65
|
+
payload: dict[str, Any] = {
|
|
66
|
+
"stockCodes": stock_codes,
|
|
67
|
+
"metricsList": metrics,
|
|
68
|
+
}
|
|
69
|
+
if date is not None:
|
|
70
|
+
payload["date"] = date
|
|
71
|
+
if start_date is not None:
|
|
72
|
+
payload["startDate"] = start_date
|
|
73
|
+
if end_date is not None:
|
|
74
|
+
payload["endDate"] = end_date
|
|
75
|
+
if limit is not None:
|
|
76
|
+
payload["limit"] = limit
|
|
77
|
+
|
|
78
|
+
data = await self._request("POST", "/cn/company/fs/bank", json=payload)
|
|
79
|
+
|
|
80
|
+
# Flatten nested metrics (e.g. {"q": {"ps": {"oi": {"t": ...}}}})
|
|
81
|
+
flattened_data = [flatten_dict(item) for item in data]
|
|
82
|
+
|
|
83
|
+
return get_response_df(flattened_data, BankStatementSchema)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# Functional API instance
|
|
87
|
+
_api_instance = BankStatementAPI()
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@api
|
|
91
|
+
async def get_bank_statements( # noqa: PLR0913
|
|
92
|
+
stock_codes: list[str],
|
|
93
|
+
metrics: list[str],
|
|
94
|
+
date: str | None = None,
|
|
95
|
+
start_date: str | None = None,
|
|
96
|
+
end_date: str | None = None,
|
|
97
|
+
limit: int | None = None,
|
|
98
|
+
) -> pd.DataFrame:
|
|
99
|
+
"""获取A股上市银行的财务报表数据.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
stock_codes: 股票代码列表。
|
|
103
|
+
metrics: 指标列表。
|
|
104
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。
|
|
105
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
106
|
+
end_date: 结束日期 (YYYY-MM-DD),可选。
|
|
107
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
包含A股银行财务报表数据的 DataFrame。
|
|
111
|
+
|
|
112
|
+
Example:
|
|
113
|
+
获取民生银行的营业收入::
|
|
114
|
+
|
|
115
|
+
from lixinger import get_bank_statements
|
|
116
|
+
|
|
117
|
+
df = await get_bank_statements(
|
|
118
|
+
stock_codes=["600016"],
|
|
119
|
+
metrics=["q.ps.oi.t"],
|
|
120
|
+
date="2026-03-31",
|
|
121
|
+
)
|
|
122
|
+
print(df)
|
|
123
|
+
|
|
124
|
+
"""
|
|
125
|
+
return await _api_instance.get_bank_statements(
|
|
126
|
+
stock_codes=stock_codes,
|
|
127
|
+
metrics=metrics,
|
|
128
|
+
date=date,
|
|
129
|
+
start_date=start_date,
|
|
130
|
+
end_date=end_date,
|
|
131
|
+
limit=limit,
|
|
132
|
+
)
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"""Insurance financial statement APIs."""
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
import pandas as pd
|
|
6
|
+
|
|
7
|
+
from lixinger.api.base import BaseAPI
|
|
8
|
+
from lixinger.models.cn.company.fs.insurance import InsuranceStatementSchema
|
|
9
|
+
from lixinger.utils.api import api
|
|
10
|
+
from lixinger.utils.dataframe import get_response_df
|
|
11
|
+
from lixinger.utils.dict import flatten_dict
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class InsuranceStatementAPI(BaseAPI):
|
|
15
|
+
"""Insurance financial statement APIs."""
|
|
16
|
+
|
|
17
|
+
async def get_insurance_statements( # noqa: PLR0913
|
|
18
|
+
self,
|
|
19
|
+
stock_codes: list[str],
|
|
20
|
+
metrics: list[str],
|
|
21
|
+
date: str | None = None,
|
|
22
|
+
start_date: str | None = None,
|
|
23
|
+
end_date: str | None = None,
|
|
24
|
+
limit: int | None = None,
|
|
25
|
+
) -> pd.DataFrame:
|
|
26
|
+
"""获取A股保险公司的财务报表数据.
|
|
27
|
+
|
|
28
|
+
API Endpoint: /cn/company/fs/insurance
|
|
29
|
+
API Method: POST
|
|
30
|
+
API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/company/fs/insurance
|
|
31
|
+
|
|
32
|
+
获取A股保险公司的财务报表数据,包括利润表、资产负债表、现金流量表、
|
|
33
|
+
正常财务指标以及保险公司特有财务指标(内含价值、新业务价值、
|
|
34
|
+
核心偿付能力充足率、综合偿付能力充足率等)。
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
stock_codes: 股票代码列表,长度 >=1 且 <=100。当传入 start_date
|
|
38
|
+
时只能传入一个股票代码。
|
|
39
|
+
metrics: 指标列表,格式为
|
|
40
|
+
``[granularity].[tableName].[fieldName].[expressionCalculateType]``,
|
|
41
|
+
例如 ``"q.ps.toi.t"``。当 stock_codes 长度大于 1 时最多 48 个
|
|
42
|
+
指标;等于 1 时最多 128 个指标。
|
|
43
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
|
|
44
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
45
|
+
end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
|
|
46
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
包含A股保险公司财务报表数据的 DataFrame。
|
|
50
|
+
|
|
51
|
+
Example:
|
|
52
|
+
获取中国平安的营业总收入::
|
|
53
|
+
|
|
54
|
+
from lixinger import AsyncLixingerClient
|
|
55
|
+
|
|
56
|
+
async with AsyncLixingerClient() as client:
|
|
57
|
+
df = await client.cn_company.fs.insurance.get_insurance_statements(
|
|
58
|
+
stock_codes=["601318"],
|
|
59
|
+
metrics=["q.ps.toi.t"],
|
|
60
|
+
date="2026-03-31",
|
|
61
|
+
)
|
|
62
|
+
print(df)
|
|
63
|
+
|
|
64
|
+
"""
|
|
65
|
+
payload: dict[str, Any] = {
|
|
66
|
+
"stockCodes": stock_codes,
|
|
67
|
+
"metricsList": metrics,
|
|
68
|
+
}
|
|
69
|
+
if date is not None:
|
|
70
|
+
payload["date"] = date
|
|
71
|
+
if start_date is not None:
|
|
72
|
+
payload["startDate"] = start_date
|
|
73
|
+
if end_date is not None:
|
|
74
|
+
payload["endDate"] = end_date
|
|
75
|
+
if limit is not None:
|
|
76
|
+
payload["limit"] = limit
|
|
77
|
+
|
|
78
|
+
data = await self._request("POST", "/cn/company/fs/insurance", json=payload)
|
|
79
|
+
|
|
80
|
+
# Flatten nested metrics (e.g. {"q": {"ps": {"toi": {"t": ...}}}})
|
|
81
|
+
flattened_data = [flatten_dict(item) for item in data]
|
|
82
|
+
|
|
83
|
+
return get_response_df(flattened_data, InsuranceStatementSchema)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# Functional API instance
|
|
87
|
+
_api_instance = InsuranceStatementAPI()
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@api
|
|
91
|
+
async def get_insurance_statements( # noqa: PLR0913
|
|
92
|
+
stock_codes: list[str],
|
|
93
|
+
metrics: list[str],
|
|
94
|
+
date: str | None = None,
|
|
95
|
+
start_date: str | None = None,
|
|
96
|
+
end_date: str | None = None,
|
|
97
|
+
limit: int | None = None,
|
|
98
|
+
) -> pd.DataFrame:
|
|
99
|
+
"""获取A股保险公司的财务报表数据.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
stock_codes: 股票代码列表。
|
|
103
|
+
metrics: 指标列表。
|
|
104
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。
|
|
105
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
106
|
+
end_date: 结束日期 (YYYY-MM-DD),可选。
|
|
107
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
包含A股保险公司财务报表数据的 DataFrame。
|
|
111
|
+
|
|
112
|
+
Example:
|
|
113
|
+
获取中国平安的营业总收入::
|
|
114
|
+
|
|
115
|
+
from lixinger import get_insurance_statements
|
|
116
|
+
|
|
117
|
+
df = await get_insurance_statements(
|
|
118
|
+
stock_codes=["601318"],
|
|
119
|
+
metrics=["q.ps.toi.t"],
|
|
120
|
+
date="2026-03-31",
|
|
121
|
+
)
|
|
122
|
+
print(df)
|
|
123
|
+
|
|
124
|
+
"""
|
|
125
|
+
return await _api_instance.get_insurance_statements(
|
|
126
|
+
stock_codes=stock_codes,
|
|
127
|
+
metrics=metrics,
|
|
128
|
+
date=date,
|
|
129
|
+
start_date=start_date,
|
|
130
|
+
end_date=end_date,
|
|
131
|
+
limit=limit,
|
|
132
|
+
)
|
|
@@ -14,13 +14,14 @@ from lixinger.utils.dict import flatten_dict
|
|
|
14
14
|
class NonFinancialStatementAPI(BaseAPI):
|
|
15
15
|
"""Non-financial statement APIs."""
|
|
16
16
|
|
|
17
|
-
async def get_non_financial_statements(
|
|
17
|
+
async def get_non_financial_statements( # noqa: PLR0913
|
|
18
18
|
self,
|
|
19
19
|
stock_codes: list[str],
|
|
20
20
|
metrics: list[str],
|
|
21
21
|
date: str | None = None,
|
|
22
22
|
start_date: str | None = None,
|
|
23
23
|
end_date: str | None = None,
|
|
24
|
+
limit: int | None = None,
|
|
24
25
|
) -> pd.DataFrame:
|
|
25
26
|
"""获取非金融企业财务报表数据.
|
|
26
27
|
|
|
@@ -34,6 +35,7 @@ class NonFinancialStatementAPI(BaseAPI):
|
|
|
34
35
|
date: 日期 (YYYY-MM-DD), 与 startDate 二选一
|
|
35
36
|
start_date: 开始日期 (YYYY-MM-DD), 与 date 二选一
|
|
36
37
|
end_date: 结束日期 (YYYY-MM-DD), 可选
|
|
38
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效
|
|
37
39
|
|
|
38
40
|
"""
|
|
39
41
|
payload: dict[str, Any] = {
|
|
@@ -46,6 +48,8 @@ class NonFinancialStatementAPI(BaseAPI):
|
|
|
46
48
|
payload["startDate"] = start_date
|
|
47
49
|
if end_date is not None:
|
|
48
50
|
payload["endDate"] = end_date
|
|
51
|
+
if limit is not None:
|
|
52
|
+
payload["limit"] = limit
|
|
49
53
|
|
|
50
54
|
data = await self._request("POST", "/cn/company/fs/non_financial", json=payload)
|
|
51
55
|
|
|
@@ -60,12 +64,13 @@ _api_instance = NonFinancialStatementAPI()
|
|
|
60
64
|
|
|
61
65
|
|
|
62
66
|
@api
|
|
63
|
-
async def get_non_financial_statements(
|
|
67
|
+
async def get_non_financial_statements( # noqa: PLR0913
|
|
64
68
|
stock_codes: list[str],
|
|
65
69
|
metrics: list[str],
|
|
66
70
|
date: str | None = None,
|
|
67
71
|
start_date: str | None = None,
|
|
68
72
|
end_date: str | None = None,
|
|
73
|
+
limit: int | None = None,
|
|
69
74
|
) -> pd.DataFrame:
|
|
70
75
|
"""获取非金融企业财务报表数据."""
|
|
71
76
|
return await _api_instance.get_non_financial_statements(
|
|
@@ -74,4 +79,5 @@ async def get_non_financial_statements(
|
|
|
74
79
|
date=date,
|
|
75
80
|
start_date=start_date,
|
|
76
81
|
end_date=end_date,
|
|
82
|
+
limit=limit,
|
|
77
83
|
)
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""Other financial company financial statement APIs."""
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
import pandas as pd
|
|
6
|
+
|
|
7
|
+
from lixinger.api.base import BaseAPI
|
|
8
|
+
from lixinger.models.cn.company.fs.other_financial import OtherFinancialStatementSchema
|
|
9
|
+
from lixinger.utils.api import api
|
|
10
|
+
from lixinger.utils.dataframe import get_response_df
|
|
11
|
+
from lixinger.utils.dict import flatten_dict
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class OtherFinancialStatementAPI(BaseAPI):
|
|
15
|
+
"""Other financial company financial statement APIs."""
|
|
16
|
+
|
|
17
|
+
async def get_other_financial_statements( # noqa: PLR0913
|
|
18
|
+
self,
|
|
19
|
+
stock_codes: list[str],
|
|
20
|
+
metrics: list[str],
|
|
21
|
+
date: str | None = None,
|
|
22
|
+
start_date: str | None = None,
|
|
23
|
+
end_date: str | None = None,
|
|
24
|
+
limit: int | None = None,
|
|
25
|
+
) -> pd.DataFrame:
|
|
26
|
+
"""获取A股其他金融公司(租赁、消费金融等)的财务报表数据.
|
|
27
|
+
|
|
28
|
+
API Endpoint: /cn/company/fs/other_financial
|
|
29
|
+
API Method: POST
|
|
30
|
+
API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/company/fs/other_financial
|
|
31
|
+
|
|
32
|
+
获取A股其他金融公司(租赁、消费金融等)的财务报表数据,包括利润表、
|
|
33
|
+
资产负债表、现金流量表以及各类财务指标。
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
stock_codes: 股票代码列表,长度 >=1 且 <=100。当传入 start_date
|
|
37
|
+
时只能传入一个股票代码。
|
|
38
|
+
metrics: 指标列表,格式为
|
|
39
|
+
``[granularity].[tableName].[fieldName].[expressionCalculateType]``,
|
|
40
|
+
例如 ``"q.ps.toi.t"``。当 stock_codes 长度大于 1 时最多 48 个
|
|
41
|
+
指标;等于 1 时最多 128 个指标。
|
|
42
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
|
|
43
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
44
|
+
end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
|
|
45
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
包含A股其他金融公司财务报表数据的 DataFrame。
|
|
49
|
+
|
|
50
|
+
Example:
|
|
51
|
+
获取江苏租赁的营业总收入::
|
|
52
|
+
|
|
53
|
+
from lixinger import AsyncLixingerClient
|
|
54
|
+
|
|
55
|
+
async with AsyncLixingerClient() as client:
|
|
56
|
+
df = await client.cn_company.fs.other_financial.get_other_financial_statements(
|
|
57
|
+
stock_codes=["600901"],
|
|
58
|
+
metrics=["q.ps.toi.t"],
|
|
59
|
+
date="2026-03-31",
|
|
60
|
+
)
|
|
61
|
+
print(df)
|
|
62
|
+
|
|
63
|
+
"""
|
|
64
|
+
payload: dict[str, Any] = {
|
|
65
|
+
"stockCodes": stock_codes,
|
|
66
|
+
"metricsList": metrics,
|
|
67
|
+
}
|
|
68
|
+
if date is not None:
|
|
69
|
+
payload["date"] = date
|
|
70
|
+
if start_date is not None:
|
|
71
|
+
payload["startDate"] = start_date
|
|
72
|
+
if end_date is not None:
|
|
73
|
+
payload["endDate"] = end_date
|
|
74
|
+
if limit is not None:
|
|
75
|
+
payload["limit"] = limit
|
|
76
|
+
|
|
77
|
+
data = await self._request("POST", "/cn/company/fs/other_financial", json=payload)
|
|
78
|
+
|
|
79
|
+
# Flatten nested metrics (e.g. {"q": {"ps": {"toi": {"t": ...}}}})
|
|
80
|
+
flattened_data = [flatten_dict(item) for item in data]
|
|
81
|
+
|
|
82
|
+
return get_response_df(flattened_data, OtherFinancialStatementSchema)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# Functional API instance
|
|
86
|
+
_api_instance = OtherFinancialStatementAPI()
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
@api
|
|
90
|
+
async def get_other_financial_statements( # noqa: PLR0913
|
|
91
|
+
stock_codes: list[str],
|
|
92
|
+
metrics: list[str],
|
|
93
|
+
date: str | None = None,
|
|
94
|
+
start_date: str | None = None,
|
|
95
|
+
end_date: str | None = None,
|
|
96
|
+
limit: int | None = None,
|
|
97
|
+
) -> pd.DataFrame:
|
|
98
|
+
"""获取A股其他金融公司(租赁、消费金融等)的财务报表数据.
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
stock_codes: 股票代码列表。
|
|
102
|
+
metrics: 指标列表。
|
|
103
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。
|
|
104
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
105
|
+
end_date: 结束日期 (YYYY-MM-DD),可选。
|
|
106
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
107
|
+
|
|
108
|
+
Returns:
|
|
109
|
+
包含A股其他金融公司财务报表数据的 DataFrame。
|
|
110
|
+
|
|
111
|
+
Example:
|
|
112
|
+
获取江苏租赁的营业总收入::
|
|
113
|
+
|
|
114
|
+
from lixinger import get_other_financial_statements
|
|
115
|
+
|
|
116
|
+
df = await get_other_financial_statements(
|
|
117
|
+
stock_codes=["600901"],
|
|
118
|
+
metrics=["q.ps.toi.t"],
|
|
119
|
+
date="2026-03-31",
|
|
120
|
+
)
|
|
121
|
+
print(df)
|
|
122
|
+
|
|
123
|
+
"""
|
|
124
|
+
return await _api_instance.get_other_financial_statements(
|
|
125
|
+
stock_codes=stock_codes,
|
|
126
|
+
metrics=metrics,
|
|
127
|
+
date=date,
|
|
128
|
+
start_date=start_date,
|
|
129
|
+
end_date=end_date,
|
|
130
|
+
limit=limit,
|
|
131
|
+
)
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"""Security (securities firm) financial statement APIs."""
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
import pandas as pd
|
|
6
|
+
|
|
7
|
+
from lixinger.api.base import BaseAPI
|
|
8
|
+
from lixinger.models.cn.company.fs.security import SecurityStatementSchema
|
|
9
|
+
from lixinger.utils.api import api
|
|
10
|
+
from lixinger.utils.dataframe import get_response_df
|
|
11
|
+
from lixinger.utils.dict import flatten_dict
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class SecurityStatementAPI(BaseAPI):
|
|
15
|
+
"""Security (securities firm) financial statement APIs."""
|
|
16
|
+
|
|
17
|
+
async def get_security_statements( # noqa: PLR0913
|
|
18
|
+
self,
|
|
19
|
+
stock_codes: list[str],
|
|
20
|
+
metrics: list[str],
|
|
21
|
+
date: str | None = None,
|
|
22
|
+
start_date: str | None = None,
|
|
23
|
+
end_date: str | None = None,
|
|
24
|
+
limit: int | None = None,
|
|
25
|
+
) -> pd.DataFrame:
|
|
26
|
+
"""获取A股证券公司的财务报表数据.
|
|
27
|
+
|
|
28
|
+
API Endpoint: /cn/company/fs/security
|
|
29
|
+
API Method: POST
|
|
30
|
+
API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/company/fs/security
|
|
31
|
+
|
|
32
|
+
获取A股证券公司的财务报表数据,包括利润表、资产负债表、现金流量表、
|
|
33
|
+
正常财务指标以及证券公司特有财务指标(净资本、风险覆盖率、
|
|
34
|
+
资本杠杆率、流动性覆盖率、净稳定资金率等)。
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
stock_codes: 股票代码列表,长度 >=1 且 <=100。当传入 start_date
|
|
38
|
+
时只能传入一个股票代码。
|
|
39
|
+
metrics: 指标列表,格式为
|
|
40
|
+
``[granularity].[tableName].[fieldName].[expressionCalculateType]``,
|
|
41
|
+
例如 ``"q.ps.toi.t"``。当 stock_codes 长度大于 1 时最多 48 个
|
|
42
|
+
指标;等于 1 时最多 128 个指标。
|
|
43
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
|
|
44
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
45
|
+
end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
|
|
46
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
包含A股证券公司财务报表数据的 DataFrame。
|
|
50
|
+
|
|
51
|
+
Example:
|
|
52
|
+
获取中信证券的营业总收入::
|
|
53
|
+
|
|
54
|
+
from lixinger import AsyncLixingerClient
|
|
55
|
+
|
|
56
|
+
async with AsyncLixingerClient() as client:
|
|
57
|
+
df = await client.cn_company.fs.security.get_security_statements(
|
|
58
|
+
stock_codes=["600030"],
|
|
59
|
+
metrics=["q.ps.toi.t"],
|
|
60
|
+
date="2026-03-31",
|
|
61
|
+
)
|
|
62
|
+
print(df)
|
|
63
|
+
|
|
64
|
+
"""
|
|
65
|
+
payload: dict[str, Any] = {
|
|
66
|
+
"stockCodes": stock_codes,
|
|
67
|
+
"metricsList": metrics,
|
|
68
|
+
}
|
|
69
|
+
if date is not None:
|
|
70
|
+
payload["date"] = date
|
|
71
|
+
if start_date is not None:
|
|
72
|
+
payload["startDate"] = start_date
|
|
73
|
+
if end_date is not None:
|
|
74
|
+
payload["endDate"] = end_date
|
|
75
|
+
if limit is not None:
|
|
76
|
+
payload["limit"] = limit
|
|
77
|
+
|
|
78
|
+
data = await self._request("POST", "/cn/company/fs/security", json=payload)
|
|
79
|
+
|
|
80
|
+
# Flatten nested metrics (e.g. {"q": {"ps": {"toi": {"t": ...}}}})
|
|
81
|
+
flattened_data = [flatten_dict(item) for item in data]
|
|
82
|
+
|
|
83
|
+
return get_response_df(flattened_data, SecurityStatementSchema)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# Functional API instance
|
|
87
|
+
_api_instance = SecurityStatementAPI()
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@api
|
|
91
|
+
async def get_security_statements( # noqa: PLR0913
|
|
92
|
+
stock_codes: list[str],
|
|
93
|
+
metrics: list[str],
|
|
94
|
+
date: str | None = None,
|
|
95
|
+
start_date: str | None = None,
|
|
96
|
+
end_date: str | None = None,
|
|
97
|
+
limit: int | None = None,
|
|
98
|
+
) -> pd.DataFrame:
|
|
99
|
+
"""获取A股证券公司的财务报表数据.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
stock_codes: 股票代码列表。
|
|
103
|
+
metrics: 指标列表。
|
|
104
|
+
date: 日期 (YYYY-MM-DD),与 start_date 二选一。
|
|
105
|
+
start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
|
|
106
|
+
end_date: 结束日期 (YYYY-MM-DD),可选。
|
|
107
|
+
limit: 返回最近数据的数量,仅在 date range 请求下生效。
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
包含A股证券公司财务报表数据的 DataFrame。
|
|
111
|
+
|
|
112
|
+
Example:
|
|
113
|
+
获取中信证券的营业总收入::
|
|
114
|
+
|
|
115
|
+
from lixinger import get_security_statements
|
|
116
|
+
|
|
117
|
+
df = await get_security_statements(
|
|
118
|
+
stock_codes=["600030"],
|
|
119
|
+
metrics=["q.ps.toi.t"],
|
|
120
|
+
date="2026-03-31",
|
|
121
|
+
)
|
|
122
|
+
print(df)
|
|
123
|
+
|
|
124
|
+
"""
|
|
125
|
+
return await _api_instance.get_security_statements(
|
|
126
|
+
stock_codes=stock_codes,
|
|
127
|
+
metrics=metrics,
|
|
128
|
+
date=date,
|
|
129
|
+
start_date=start_date,
|
|
130
|
+
end_date=end_date,
|
|
131
|
+
limit=limit,
|
|
132
|
+
)
|
|
@@ -5,7 +5,11 @@ from lixinger.api.cn.company.candlestick import CandlestickAPI
|
|
|
5
5
|
from lixinger.api.cn.company.company import CompanyAPI
|
|
6
6
|
from lixinger.api.cn.company.dividend import DividendAPI
|
|
7
7
|
from lixinger.api.cn.company.equity_change import EquityChangeAPI
|
|
8
|
+
from lixinger.api.cn.company.fs.bank import BankStatementAPI
|
|
9
|
+
from lixinger.api.cn.company.fs.insurance import InsuranceStatementAPI
|
|
8
10
|
from lixinger.api.cn.company.fs.non_financial import NonFinancialStatementAPI
|
|
11
|
+
from lixinger.api.cn.company.fs.other_financial import OtherFinancialStatementAPI
|
|
12
|
+
from lixinger.api.cn.company.fs.security import SecurityStatementAPI
|
|
9
13
|
from lixinger.api.cn.company.fundamental.bank import BankFundamentalAPI
|
|
10
14
|
from lixinger.api.cn.company.fundamental.insurance import InsuranceFundamentalAPI
|
|
11
15
|
from lixinger.api.cn.company.fundamental.non_financial import NonFinancialFundamentalAPI
|
|
@@ -43,11 +47,31 @@ class FundamentalNamespace:
|
|
|
43
47
|
|
|
44
48
|
|
|
45
49
|
class FSNamespace:
|
|
46
|
-
"""Namespace for financial statement APIs.
|
|
50
|
+
"""Namespace for financial statement APIs.
|
|
47
51
|
|
|
48
|
-
|
|
52
|
+
Groups all financial statement APIs by company type:
|
|
53
|
+
|
|
54
|
+
- non_financial: Non-financial companies (非金融企业)
|
|
55
|
+
- bank: Banks (银行)
|
|
56
|
+
- insurance: Insurance companies (保险)
|
|
57
|
+
- security: Securities companies (证券)
|
|
58
|
+
- other_financial: Other financial companies (租赁、消费金融等)
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
def __init__(
|
|
62
|
+
self,
|
|
63
|
+
non_financial: NonFinancialStatementAPI,
|
|
64
|
+
bank: BankStatementAPI,
|
|
65
|
+
insurance: InsuranceStatementAPI,
|
|
66
|
+
security: SecurityStatementAPI,
|
|
67
|
+
other_financial: OtherFinancialStatementAPI,
|
|
68
|
+
):
|
|
49
69
|
"""Initialize the financial statement namespace."""
|
|
50
70
|
self.non_financial = non_financial
|
|
71
|
+
self.bank = bank
|
|
72
|
+
self.insurance = insurance
|
|
73
|
+
self.security = security
|
|
74
|
+
self.other_financial = other_financial
|
|
51
75
|
|
|
52
76
|
|
|
53
77
|
class CompanyNamespace:
|
|
@@ -66,8 +90,12 @@ class CompanyNamespace:
|
|
|
66
90
|
- fundamental.security: Securities company fundamental data
|
|
67
91
|
- fundamental.other_financial: Other financial company fundamental data
|
|
68
92
|
- candlestick: Candlestick data API
|
|
69
|
-
- fs: Financial statement APIs
|
|
93
|
+
- fs: Financial statement APIs (contains sub-APIs for different company types)
|
|
70
94
|
- fs.non_financial: Non-financial statements API
|
|
95
|
+
- fs.bank: Bank statements API
|
|
96
|
+
- fs.insurance: Insurance statements API
|
|
97
|
+
- fs.security: Security statements API
|
|
98
|
+
- fs.other_financial: Other financial company statements API
|
|
71
99
|
- indices: Company indices API
|
|
72
100
|
- dividend: Dividend data API
|
|
73
101
|
- announcement: Announcement data API
|
|
@@ -86,6 +114,10 @@ class CompanyNamespace:
|
|
|
86
114
|
fundamental_other_financial: OtherFinancialFundamentalAPI,
|
|
87
115
|
candlestick: CandlestickAPI,
|
|
88
116
|
fs_non_financial: NonFinancialStatementAPI,
|
|
117
|
+
fs_bank: BankStatementAPI,
|
|
118
|
+
fs_insurance: InsuranceStatementAPI,
|
|
119
|
+
fs_security: SecurityStatementAPI,
|
|
120
|
+
fs_other_financial: OtherFinancialStatementAPI,
|
|
89
121
|
indices: IndicesAPI,
|
|
90
122
|
dividend: DividendAPI,
|
|
91
123
|
announcement: AnnouncementAPI,
|
|
@@ -103,6 +135,10 @@ class CompanyNamespace:
|
|
|
103
135
|
fundamental_other_financial: Other financial company fundamental data API
|
|
104
136
|
candlestick: Candlestick data API
|
|
105
137
|
fs_non_financial: Non-financial statements API
|
|
138
|
+
fs_bank: Bank statements API
|
|
139
|
+
fs_insurance: Insurance statements API
|
|
140
|
+
fs_security: Security statements API
|
|
141
|
+
fs_other_financial: Other financial company statements API
|
|
106
142
|
indices: Company indices API
|
|
107
143
|
dividend: Dividend data API
|
|
108
144
|
announcement: Announcement data API
|
|
@@ -119,7 +155,13 @@ class CompanyNamespace:
|
|
|
119
155
|
other_financial=fundamental_other_financial,
|
|
120
156
|
)
|
|
121
157
|
self.candlestick = candlestick
|
|
122
|
-
self.fs = FSNamespace(
|
|
158
|
+
self.fs = FSNamespace(
|
|
159
|
+
non_financial=fs_non_financial,
|
|
160
|
+
bank=fs_bank,
|
|
161
|
+
insurance=fs_insurance,
|
|
162
|
+
security=fs_security,
|
|
163
|
+
other_financial=fs_other_financial,
|
|
164
|
+
)
|
|
123
165
|
self.indices = indices
|
|
124
166
|
self.dividend = dividend
|
|
125
167
|
self.announcement = announcement
|
lixinger/client.py
CHANGED
|
@@ -5,7 +5,11 @@ from lixinger.api.cn.company.candlestick import CandlestickAPI
|
|
|
5
5
|
from lixinger.api.cn.company.company import CompanyAPI
|
|
6
6
|
from lixinger.api.cn.company.dividend import DividendAPI
|
|
7
7
|
from lixinger.api.cn.company.equity_change import EquityChangeAPI
|
|
8
|
+
from lixinger.api.cn.company.fs.bank import BankStatementAPI
|
|
9
|
+
from lixinger.api.cn.company.fs.insurance import InsuranceStatementAPI
|
|
8
10
|
from lixinger.api.cn.company.fs.non_financial import NonFinancialStatementAPI
|
|
11
|
+
from lixinger.api.cn.company.fs.other_financial import OtherFinancialStatementAPI
|
|
12
|
+
from lixinger.api.cn.company.fs.security import SecurityStatementAPI
|
|
9
13
|
from lixinger.api.cn.company.fundamental.bank import BankFundamentalAPI
|
|
10
14
|
from lixinger.api.cn.company.fundamental.insurance import InsuranceFundamentalAPI
|
|
11
15
|
from lixinger.api.cn.company.fundamental.non_financial import NonFinancialFundamentalAPI
|
|
@@ -134,6 +138,10 @@ class AsyncLixingerClient:
|
|
|
134
138
|
)
|
|
135
139
|
cn_company_candlestick = CandlestickAPI(self._http_client, self.config, self._rate_limiter)
|
|
136
140
|
cn_company_fs_non_financial = NonFinancialStatementAPI(self._http_client, self.config, self._rate_limiter)
|
|
141
|
+
cn_company_fs_bank = BankStatementAPI(self._http_client, self.config, self._rate_limiter)
|
|
142
|
+
cn_company_fs_insurance = InsuranceStatementAPI(self._http_client, self.config, self._rate_limiter)
|
|
143
|
+
cn_company_fs_security = SecurityStatementAPI(self._http_client, self.config, self._rate_limiter)
|
|
144
|
+
cn_company_fs_other_financial = OtherFinancialStatementAPI(self._http_client, self.config, self._rate_limiter)
|
|
137
145
|
cn_company_indices = IndicesAPI(self._http_client, self.config, self._rate_limiter)
|
|
138
146
|
cn_company_dividend = DividendAPI(self._http_client, self.config, self._rate_limiter)
|
|
139
147
|
cn_company_announcement = AnnouncementAPI(self._http_client, self.config, self._rate_limiter)
|
|
@@ -150,6 +158,10 @@ class AsyncLixingerClient:
|
|
|
150
158
|
fundamental_other_financial=cn_company_fundamental_other_financial,
|
|
151
159
|
candlestick=cn_company_candlestick,
|
|
152
160
|
fs_non_financial=cn_company_fs_non_financial,
|
|
161
|
+
fs_bank=cn_company_fs_bank,
|
|
162
|
+
fs_insurance=cn_company_fs_insurance,
|
|
163
|
+
fs_security=cn_company_fs_security,
|
|
164
|
+
fs_other_financial=cn_company_fs_other_financial,
|
|
153
165
|
indices=cn_company_indices,
|
|
154
166
|
dividend=cn_company_dividend,
|
|
155
167
|
announcement=cn_company_announcement,
|
|
@@ -158,6 +170,10 @@ class AsyncLixingerClient:
|
|
|
158
170
|
# Legacy flat access (deprecated, for backward compatibility)
|
|
159
171
|
self.cn_company_candlestick = cn_company_candlestick
|
|
160
172
|
self.cn_company_fs_non_financial = cn_company_fs_non_financial
|
|
173
|
+
self.cn_company_fs_bank = cn_company_fs_bank
|
|
174
|
+
self.cn_company_fs_insurance = cn_company_fs_insurance
|
|
175
|
+
self.cn_company_fs_security = cn_company_fs_security
|
|
176
|
+
self.cn_company_fs_other_financial = cn_company_fs_other_financial
|
|
161
177
|
self.cn_company_indices = cn_company_indices
|
|
162
178
|
self.cn_company_dividend = cn_company_dividend
|
|
163
179
|
self.cn_company_announcement = cn_company_announcement
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
"""Financial statement models."""
|
|
2
2
|
|
|
3
|
+
from lixinger.models.cn.company.fs.bank import BankStatementSchema
|
|
4
|
+
from lixinger.models.cn.company.fs.insurance import InsuranceStatementSchema
|
|
3
5
|
from lixinger.models.cn.company.fs.non_financial import NonFinancialStatementSchema
|
|
6
|
+
from lixinger.models.cn.company.fs.other_financial import OtherFinancialStatementSchema
|
|
7
|
+
from lixinger.models.cn.company.fs.security import SecurityStatementSchema
|
|
4
8
|
|
|
5
|
-
__all__ = [
|
|
9
|
+
__all__ = [
|
|
10
|
+
"BankStatementSchema",
|
|
11
|
+
"InsuranceStatementSchema",
|
|
12
|
+
"NonFinancialStatementSchema",
|
|
13
|
+
"OtherFinancialStatementSchema",
|
|
14
|
+
"SecurityStatementSchema",
|
|
15
|
+
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Bank financial statement models."""
|
|
2
|
+
|
|
3
|
+
import pandera.pandas as pa
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class BankStatementSchema(pa.DataFrameModel):
|
|
7
|
+
"""Bank financial statement model."""
|
|
8
|
+
|
|
9
|
+
class Config:
|
|
10
|
+
"""Pandera configuration."""
|
|
11
|
+
|
|
12
|
+
coerce = True
|
|
13
|
+
strict = False # Allow extra metrics columns
|
|
14
|
+
|
|
15
|
+
date: pa.typing.Series[pa.typing.DateTime]
|
|
16
|
+
stock_code: pa.typing.Series[str]
|
|
17
|
+
currency: pa.typing.Series[str]
|
|
18
|
+
report_date: pa.typing.Series[pa.typing.DateTime]
|
|
19
|
+
report_type: pa.typing.Series[str]
|
|
20
|
+
standard_date: pa.typing.Series[pa.typing.DateTime]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Insurance financial statement models."""
|
|
2
|
+
|
|
3
|
+
import pandera.pandas as pa
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class InsuranceStatementSchema(pa.DataFrameModel):
|
|
7
|
+
"""Insurance financial statement model."""
|
|
8
|
+
|
|
9
|
+
class Config:
|
|
10
|
+
"""Pandera configuration."""
|
|
11
|
+
|
|
12
|
+
coerce = True
|
|
13
|
+
strict = False # Allow extra metrics columns
|
|
14
|
+
|
|
15
|
+
date: pa.typing.Series[pa.typing.DateTime]
|
|
16
|
+
stock_code: pa.typing.Series[str]
|
|
17
|
+
currency: pa.typing.Series[str]
|
|
18
|
+
report_date: pa.typing.Series[pa.typing.DateTime]
|
|
19
|
+
report_type: pa.typing.Series[str]
|
|
20
|
+
standard_date: pa.typing.Series[pa.typing.DateTime]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Other financial company financial statement models."""
|
|
2
|
+
|
|
3
|
+
import pandera.pandas as pa
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class OtherFinancialStatementSchema(pa.DataFrameModel):
|
|
7
|
+
"""Other financial company financial statement model."""
|
|
8
|
+
|
|
9
|
+
class Config:
|
|
10
|
+
"""Pandera configuration."""
|
|
11
|
+
|
|
12
|
+
coerce = True
|
|
13
|
+
strict = False # Allow extra metrics columns
|
|
14
|
+
|
|
15
|
+
date: pa.typing.Series[pa.typing.DateTime]
|
|
16
|
+
stock_code: pa.typing.Series[str]
|
|
17
|
+
currency: pa.typing.Series[str]
|
|
18
|
+
report_date: pa.typing.Series[pa.typing.DateTime]
|
|
19
|
+
report_type: pa.typing.Series[str]
|
|
20
|
+
standard_date: pa.typing.Series[pa.typing.DateTime]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Security (securities firm) financial statement models."""
|
|
2
|
+
|
|
3
|
+
import pandera.pandas as pa
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SecurityStatementSchema(pa.DataFrameModel):
|
|
7
|
+
"""Security (securities firm) financial statement model."""
|
|
8
|
+
|
|
9
|
+
class Config:
|
|
10
|
+
"""Pandera configuration."""
|
|
11
|
+
|
|
12
|
+
coerce = True
|
|
13
|
+
strict = False # Allow extra metrics columns
|
|
14
|
+
|
|
15
|
+
date: pa.typing.Series[pa.typing.DateTime]
|
|
16
|
+
stock_code: pa.typing.Series[str]
|
|
17
|
+
currency: pa.typing.Series[str]
|
|
18
|
+
report_date: pa.typing.Series[pa.typing.DateTime]
|
|
19
|
+
report_type: pa.typing.Series[str]
|
|
20
|
+
standard_date: pa.typing.Series[pa.typing.DateTime]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
lixinger/__init__.py,sha256=
|
|
2
|
-
lixinger/client.py,sha256=
|
|
1
|
+
lixinger/__init__.py,sha256=sJ29I0A6B_tfYReum3zhSxr6B_fVmVG5JR0LmEvIAiY,2688
|
|
2
|
+
lixinger/client.py,sha256=3bLqyLsAUm-8OHZSJ9yMeN-vSReVRjhhGLm4nwhqmT0,12462
|
|
3
3
|
lixinger/config.py,sha256=JPz8EOrf1kP4Do-Z5-MsnOM0pMrNE1ZsP-Qoarh9y4c,2008
|
|
4
4
|
lixinger/exceptions.py,sha256=eWSDO-3CRESPsfzomzMc-9NYPBQ1EEPJ_CPSIo-UlDM,508
|
|
5
5
|
lixinger/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -13,10 +13,14 @@ lixinger/api/cn/company/company.py,sha256=D6yhmFPzhdWadBsNka-8h4mkbKjD4HoBFQCw72
|
|
|
13
13
|
lixinger/api/cn/company/dividend.py,sha256=21AWQbi56G7wVf8sv_YSy-Qy36OFKSvB9L2M3cbslGc,2658
|
|
14
14
|
lixinger/api/cn/company/equity_change.py,sha256=hf2SZhvCcYvu1lRhEz-b61yo9D7mDckKJSerAxGvsXI,2356
|
|
15
15
|
lixinger/api/cn/company/indices.py,sha256=GFoCf58DDh1a4Fx4lGaqPmk9NBW0hlRbnaIYoXBtFXI,1161
|
|
16
|
-
lixinger/api/cn/company/namespace.py,sha256=
|
|
16
|
+
lixinger/api/cn/company/namespace.py,sha256=gb50qxxtgGcFycHLrW05hCEnz31KA32Ey8ljo2rCoDw,6854
|
|
17
17
|
lixinger/api/cn/company/profile.py,sha256=iMwR5REcJNhKvS3hpWg6bCD1DOH-7fSN21zoIeRIh3k,1691
|
|
18
|
-
lixinger/api/cn/company/fs/__init__.py,sha256=
|
|
19
|
-
lixinger/api/cn/company/fs/
|
|
18
|
+
lixinger/api/cn/company/fs/__init__.py,sha256=B21nlQ_kwTvtwGbRovbsPQfDuj5rf3YqNp03orgpV0g,1281
|
|
19
|
+
lixinger/api/cn/company/fs/bank.py,sha256=rdUvFNVWwF1ZCMzy_a6Sc7e-NUykb8OfU4MnAL-EUI4,4514
|
|
20
|
+
lixinger/api/cn/company/fs/insurance.py,sha256=s94yd80Yl6N3RI30Bz2062MbKOmiDcg6VUW_uuNztx8,4629
|
|
21
|
+
lixinger/api/cn/company/fs/non_financial.py,sha256=gMyco2L4OARQoL_EQuTQHKXCES1PjvL45kSFTLZUFSU,2599
|
|
22
|
+
lixinger/api/cn/company/fs/other_financial.py,sha256=yRycb5LgacdgGQ1jBidaMCDvc4PysYHoMUwshMLUzUU,4722
|
|
23
|
+
lixinger/api/cn/company/fs/security.py,sha256=AW6x--bA2dgNj5SL17f0lHg1XM76BNOlGXxqYlo_rZw,4645
|
|
20
24
|
lixinger/api/cn/company/fundamental/__init__.py,sha256=7UQG9tNv-RBELrUnN1OV218jcaT2Auf5oNIXxvLNo8s,1357
|
|
21
25
|
lixinger/api/cn/company/fundamental/bank.py,sha256=bvLh7XovjaCWC2k3MKucVr57S0EgK1flqv08zuPERCM,3386
|
|
22
26
|
lixinger/api/cn/company/fundamental/insurance.py,sha256=INs9UaqaRCTdv8yz09SdSZzWbUUXQRGQ39ndIBiVkm8,3497
|
|
@@ -54,8 +58,12 @@ lixinger/models/cn/company/company.py,sha256=BJRUWLifoxMVN3umOw99t8thaFcuwK244Hv
|
|
|
54
58
|
lixinger/models/cn/company/dividend.py,sha256=yvIEHtNbj22eZOG_XPCLL-zCJLefe6DjomDiRpNwqU4,2044
|
|
55
59
|
lixinger/models/cn/company/equity_change.py,sha256=8I0u8Jkfj-bnIpQi_0YHpYhrPK-1X0BON_9YcIbLVzk,860
|
|
56
60
|
lixinger/models/cn/company/indices.py,sha256=Dxi_lAZPEWy3evcUHArsST0oTmJHyYAcT2Y8suqZQdc,349
|
|
57
|
-
lixinger/models/cn/company/fs/__init__.py,sha256=
|
|
61
|
+
lixinger/models/cn/company/fs/__init__.py,sha256=LPqxRhIlzOrV_c9RUFDxIVP25N1QtyQnDvBCAqKdn1s,603
|
|
62
|
+
lixinger/models/cn/company/fs/bank.py,sha256=y5F-RdMoHzOMXc0ZF9_bpqHn3eKSoyAh1tsxPrZdbgk,562
|
|
63
|
+
lixinger/models/cn/company/fs/insurance.py,sha256=XCr1DU2r474cctVpz5VETuNQEWyGZMXQ_NqDCvg78kM,577
|
|
58
64
|
lixinger/models/cn/company/fs/non_financial.py,sha256=t2C5_dqvX1DUF_iR54UiCxis4O84YU1bUTZRdYCiaT8,568
|
|
65
|
+
lixinger/models/cn/company/fs/other_financial.py,sha256=gEE1axWGFcyT6JW5jtkKzbaCg2NpnPTiyfkR84Doy7w,610
|
|
66
|
+
lixinger/models/cn/company/fs/security.py,sha256=PdG6_w96h55ppEQMiI-j5FQS4U4bRukMG9EQHKWIImM,610
|
|
59
67
|
lixinger/models/cn/company/fundamental/__init__.py,sha256=tZ-Byn1jlkN9du6s9hzcSojUGDTQ1kDJ_QqTRnnqUik,665
|
|
60
68
|
lixinger/models/cn/company/fundamental/bank.py,sha256=CvqEfU3btDWlphJTDWMxlUyTiAPU80a4zzpeFueZAWU,373
|
|
61
69
|
lixinger/models/cn/company/fundamental/insurance.py,sha256=-bP3VeKr-0yYvGuZnolCxvoU9R4Yg3-w8czskWUpK1g,404
|
|
@@ -89,7 +97,7 @@ lixinger/utils/dataframe.py,sha256=tYBrNdmJ4poyuwD-9XgzHt3A_A8bBo0cdHiu8Yy9e9A,2
|
|
|
89
97
|
lixinger/utils/dict.py,sha256=yvbUtv8QpRmy0d_o_7gCuEwwiEfBji5_xB490ANxilw,589
|
|
90
98
|
lixinger/utils/rate_limiter.py,sha256=DCaG87kIjDU5triYHU33-FW7h6KsbELBnU9f6mCQKCU,1133
|
|
91
99
|
lixinger/utils/retry.py,sha256=sXtb0ESp12_JedjzDxoeIH48TlOrbxtIA0j1V33DW7M,1026
|
|
92
|
-
lixinger_python-0.3.
|
|
93
|
-
lixinger_python-0.3.
|
|
94
|
-
lixinger_python-0.3.
|
|
95
|
-
lixinger_python-0.3.
|
|
100
|
+
lixinger_python-0.3.8.dist-info/METADATA,sha256=rTnRLHhbIoF-zUaR81ea8zz480sjWRSVMYY0Vw6efVQ,9206
|
|
101
|
+
lixinger_python-0.3.8.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
102
|
+
lixinger_python-0.3.8.dist-info/licenses/LICENSE,sha256=5oOwRq1lHSOScbNGCHr2feuNnhNYdGcArj6fSUfsC5U,1064
|
|
103
|
+
lixinger_python-0.3.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|