lixinger-python 0.3.6__py3-none-any.whl → 0.3.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.
lixinger/__init__.py CHANGED
@@ -25,7 +25,11 @@ from lixinger.api.cn.index import (
25
25
  get_constituent_weightings,
26
26
  get_constituents,
27
27
  get_index,
28
+ get_index_bank_statements,
28
29
  get_index_fundamental,
30
+ get_index_hybrid_statements,
31
+ get_index_non_financial_statements,
32
+ get_index_security_statements,
29
33
  get_tracking_fund,
30
34
  )
31
35
  from lixinger.api.cn.index import (
@@ -74,4 +78,9 @@ __all__ = [
74
78
  "get_insurance_fundamental",
75
79
  "get_security_fundamental",
76
80
  "get_other_financial_fundamental",
81
+ # Index financial statements
82
+ "get_index_non_financial_statements",
83
+ "get_index_bank_statements",
84
+ "get_index_security_statements",
85
+ "get_index_hybrid_statements",
77
86
  ]
@@ -7,6 +7,16 @@ from lixinger.api.cn.index.constituent_weightings import (
7
7
  )
8
8
  from lixinger.api.cn.index.constituents import ConstituentsAPI, get_constituents
9
9
  from lixinger.api.cn.index.drawdown import DrawdownAPI, get_drawdown
10
+ from lixinger.api.cn.index.fs import (
11
+ IndexBankStatementAPI,
12
+ IndexHybridStatementAPI,
13
+ IndexNonFinancialStatementAPI,
14
+ IndexSecurityStatementAPI,
15
+ get_index_bank_statements,
16
+ get_index_hybrid_statements,
17
+ get_index_non_financial_statements,
18
+ get_index_security_statements,
19
+ )
10
20
  from lixinger.api.cn.index.fundamental import (
11
21
  IndexFundamentalAPI,
12
22
  get_index_fundamental,
@@ -29,4 +39,13 @@ __all__ = [
29
39
  "get_index_fundamental",
30
40
  "TrackingFundAPI",
31
41
  "get_tracking_fund",
42
+ # Index financial statements
43
+ "IndexBankStatementAPI",
44
+ "IndexHybridStatementAPI",
45
+ "IndexNonFinancialStatementAPI",
46
+ "IndexSecurityStatementAPI",
47
+ "get_index_bank_statements",
48
+ "get_index_hybrid_statements",
49
+ "get_index_non_financial_statements",
50
+ "get_index_security_statements",
32
51
  ]
@@ -0,0 +1,38 @@
1
+ """Index financial statement APIs.
2
+
3
+ This module provides access to index financial statement APIs by index type:
4
+ - Non-financial indices (非金融类指数)
5
+ - Bank indices (银行类指数)
6
+ - Security indices (证券类指数)
7
+ - Hybrid indices (混合型指数)
8
+ """
9
+
10
+ from lixinger.api.cn.index.fs.bank import (
11
+ IndexBankStatementAPI,
12
+ get_index_bank_statements,
13
+ )
14
+ from lixinger.api.cn.index.fs.hybrid import (
15
+ IndexHybridStatementAPI,
16
+ get_index_hybrid_statements,
17
+ )
18
+ from lixinger.api.cn.index.fs.non_financial import (
19
+ IndexNonFinancialStatementAPI,
20
+ get_index_non_financial_statements,
21
+ )
22
+ from lixinger.api.cn.index.fs.security import (
23
+ IndexSecurityStatementAPI,
24
+ get_index_security_statements,
25
+ )
26
+
27
+ __all__ = [
28
+ # API Classes
29
+ "IndexBankStatementAPI",
30
+ "IndexHybridStatementAPI",
31
+ "IndexNonFinancialStatementAPI",
32
+ "IndexSecurityStatementAPI",
33
+ # Functional APIs
34
+ "get_index_bank_statements",
35
+ "get_index_hybrid_statements",
36
+ "get_index_non_financial_statements",
37
+ "get_index_security_statements",
38
+ ]
@@ -0,0 +1,130 @@
1
+ """Index bank 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.index.fs.bank import IndexBankStatementSchema
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 IndexBankStatementAPI(BaseAPI):
15
+ """Index bank 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
+ """获取银行类指数的财务报表数据.
27
+
28
+ API Endpoint: /cn/index/fs/bank
29
+ API Method: POST
30
+ API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/index/fs/bank
31
+
32
+ 获取银行类大陆指数(样本仅包含银行)的财务数据,包括利润表、
33
+ 资产负债表、现金流量表、财务指标。
34
+
35
+ Args:
36
+ stock_codes: 指数代码列表,长度 >=1 且 <=100。当传入 start_date 时只能
37
+ 传入一个指数代码。
38
+ metrics: 指标列表,格式为 [granularity].[tableName].[fieldName].[expressionCalculateType],
39
+ 例如 ``"q.ps.oi.t"``。当 stock_codes 长度大于 1 时最多 48 个指标;
40
+ 等于 1 时最多 128 个指标。
41
+ date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
42
+ start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
43
+ end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
44
+ limit: 返回最近数据的数量,仅在 date range 请求下生效。
45
+
46
+ Returns:
47
+ 包含银行类指数财务报表数据的 DataFrame。
48
+
49
+ Example:
50
+ 获取中证银行指数的营业收入::
51
+
52
+ from lixinger import AsyncLixingerClient
53
+
54
+ async with AsyncLixingerClient() as client:
55
+ df = await client.index.fs.bank.get_bank_statements(
56
+ stock_codes=["399986"],
57
+ metrics=["q.ps.oi.t"],
58
+ date="2026-03-31",
59
+ )
60
+ print(df)
61
+
62
+ """
63
+ payload: dict[str, Any] = {
64
+ "stockCodes": stock_codes,
65
+ "metricsList": metrics,
66
+ }
67
+ if date is not None:
68
+ payload["date"] = date
69
+ if start_date is not None:
70
+ payload["startDate"] = start_date
71
+ if end_date is not None:
72
+ payload["endDate"] = end_date
73
+ if limit is not None:
74
+ payload["limit"] = limit
75
+
76
+ data = await self._request("POST", "/cn/index/fs/bank", json=payload)
77
+
78
+ # Flatten nested metrics (e.g. {"q": {"ps": {"oi": {"t": ...}}}})
79
+ flattened_data = [flatten_dict(item) for item in data]
80
+
81
+ return get_response_df(flattened_data, IndexBankStatementSchema)
82
+
83
+
84
+ # Functional API instance
85
+ _api_instance = IndexBankStatementAPI()
86
+
87
+
88
+ @api
89
+ async def get_index_bank_statements( # noqa: PLR0913
90
+ stock_codes: list[str],
91
+ metrics: list[str],
92
+ date: str | None = None,
93
+ start_date: str | None = None,
94
+ end_date: str | None = None,
95
+ limit: int | None = None,
96
+ ) -> pd.DataFrame:
97
+ """获取银行类指数的财务报表数据.
98
+
99
+ Args:
100
+ stock_codes: 指数代码列表。
101
+ metrics: 指标列表。
102
+ date: 日期 (YYYY-MM-DD),与 start_date 二选一。
103
+ start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
104
+ end_date: 结束日期 (YYYY-MM-DD),可选。
105
+ limit: 返回最近数据的数量,仅在 date range 请求下生效。
106
+
107
+ Returns:
108
+ 包含银行类指数财务报表数据的 DataFrame。
109
+
110
+ Example:
111
+ 获取中证银行指数的营业收入::
112
+
113
+ from lixinger import get_index_bank_statements
114
+
115
+ df = await get_index_bank_statements(
116
+ stock_codes=["399986"],
117
+ metrics=["q.ps.oi.t"],
118
+ date="2026-03-31",
119
+ )
120
+ print(df)
121
+
122
+ """
123
+ return await _api_instance.get_bank_statements(
124
+ stock_codes=stock_codes,
125
+ metrics=metrics,
126
+ date=date,
127
+ start_date=start_date,
128
+ end_date=end_date,
129
+ limit=limit,
130
+ )
@@ -0,0 +1,130 @@
1
+ """Index hybrid 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.index.fs.hybrid import IndexHybridStatementSchema
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 IndexHybridStatementAPI(BaseAPI):
15
+ """Index hybrid statement APIs."""
16
+
17
+ async def get_hybrid_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
+ """获取混合型指数的财务报表数据.
27
+
28
+ API Endpoint: /cn/index/fs/hybrid
29
+ API Method: POST
30
+ API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/index/fs/hybrid
31
+
32
+ 获取混合型大陆指数(样本同时包含金融公司和非金融公司)的财务数据,
33
+ 包括利润表、资产负债表、现金流量表、财务指标。
34
+
35
+ Args:
36
+ stock_codes: 指数代码列表,长度 >=1 且 <=100。当传入 start_date 时只能
37
+ 传入一个指数代码。
38
+ metrics: 指标列表,格式为 [granularity].[tableName].[fieldName].[expressionCalculateType],
39
+ 例如 ``"q.ps.toi.t"``。当 stock_codes 长度大于 1 时最多 48 个指标;
40
+ 等于 1 时最多 128 个指标。
41
+ date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
42
+ start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
43
+ end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
44
+ limit: 返回最近数据的数量,仅在 date range 请求下生效。
45
+
46
+ Returns:
47
+ 包含混合型指数财务报表数据的 DataFrame。
48
+
49
+ Example:
50
+ 获取上证 50 的营业总收入::
51
+
52
+ from lixinger import AsyncLixingerClient
53
+
54
+ async with AsyncLixingerClient() as client:
55
+ df = await client.index.fs.hybrid.get_hybrid_statements(
56
+ stock_codes=["000016"],
57
+ metrics=["q.ps.toi.t"],
58
+ date="2026-03-31",
59
+ )
60
+ print(df)
61
+
62
+ """
63
+ payload: dict[str, Any] = {
64
+ "stockCodes": stock_codes,
65
+ "metricsList": metrics,
66
+ }
67
+ if date is not None:
68
+ payload["date"] = date
69
+ if start_date is not None:
70
+ payload["startDate"] = start_date
71
+ if end_date is not None:
72
+ payload["endDate"] = end_date
73
+ if limit is not None:
74
+ payload["limit"] = limit
75
+
76
+ data = await self._request("POST", "/cn/index/fs/hybrid", json=payload)
77
+
78
+ # Flatten nested metrics
79
+ flattened_data = [flatten_dict(item) for item in data]
80
+
81
+ return get_response_df(flattened_data, IndexHybridStatementSchema)
82
+
83
+
84
+ # Functional API instance
85
+ _api_instance = IndexHybridStatementAPI()
86
+
87
+
88
+ @api
89
+ async def get_index_hybrid_statements( # noqa: PLR0913
90
+ stock_codes: list[str],
91
+ metrics: list[str],
92
+ date: str | None = None,
93
+ start_date: str | None = None,
94
+ end_date: str | None = None,
95
+ limit: int | None = None,
96
+ ) -> pd.DataFrame:
97
+ """获取混合型指数的财务报表数据.
98
+
99
+ Args:
100
+ stock_codes: 指数代码列表。
101
+ metrics: 指标列表。
102
+ date: 日期 (YYYY-MM-DD),与 start_date 二选一。
103
+ start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
104
+ end_date: 结束日期 (YYYY-MM-DD),可选。
105
+ limit: 返回最近数据的数量,仅在 date range 请求下生效。
106
+
107
+ Returns:
108
+ 包含混合型指数财务报表数据的 DataFrame。
109
+
110
+ Example:
111
+ 获取上证 50 的营业总收入::
112
+
113
+ from lixinger import get_index_hybrid_statements
114
+
115
+ df = await get_index_hybrid_statements(
116
+ stock_codes=["000016"],
117
+ metrics=["q.ps.toi.t"],
118
+ date="2026-03-31",
119
+ )
120
+ print(df)
121
+
122
+ """
123
+ return await _api_instance.get_hybrid_statements(
124
+ stock_codes=stock_codes,
125
+ metrics=metrics,
126
+ date=date,
127
+ start_date=start_date,
128
+ end_date=end_date,
129
+ limit=limit,
130
+ )
@@ -0,0 +1,130 @@
1
+ """Index non-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.index.fs.non_financial import IndexNonFinancialStatementSchema
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 IndexNonFinancialStatementAPI(BaseAPI):
15
+ """Index non-financial statement APIs."""
16
+
17
+ async def get_non_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
+ """获取非金融类指数的财务报表数据.
27
+
28
+ API Endpoint: /cn/index/fs/non_financial
29
+ API Method: POST
30
+ API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/index/fs/non_financial
31
+
32
+ 获取非金融类大陆指数(样本仅包含非金融公司)的财务数据,包括利润表、
33
+ 资产负债表、现金流量表、财务指标。
34
+
35
+ Args:
36
+ stock_codes: 指数代码列表,长度 >=1 且 <=100。当传入 start_date 时只能
37
+ 传入一个指数代码。
38
+ metrics: 指标列表,格式为 [granularity].[tableName].[fieldName].[expressionCalculateType],
39
+ 例如 ``"q.ps.toi.t"``。当 stock_codes 长度大于 1 时最多 48 个指标;
40
+ 等于 1 时最多 128 个指标。
41
+ date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
42
+ start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
43
+ end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
44
+ limit: 返回最近数据的数量,仅在 date range 请求下生效。
45
+
46
+ Returns:
47
+ 包含非金融类指数财务报表数据的 DataFrame。
48
+
49
+ Example:
50
+ 获取中证白酒指数的营业总收入::
51
+
52
+ from lixinger import AsyncLixingerClient
53
+
54
+ async with AsyncLixingerClient() as client:
55
+ df = await client.index.fs.non_financial.get_non_financial_statements(
56
+ stock_codes=["000932"],
57
+ metrics=["q.ps.toi.t"],
58
+ date="2026-03-31",
59
+ )
60
+ print(df)
61
+
62
+ """
63
+ payload: dict[str, Any] = {
64
+ "stockCodes": stock_codes,
65
+ "metricsList": metrics,
66
+ }
67
+ if date is not None:
68
+ payload["date"] = date
69
+ if start_date is not None:
70
+ payload["startDate"] = start_date
71
+ if end_date is not None:
72
+ payload["endDate"] = end_date
73
+ if limit is not None:
74
+ payload["limit"] = limit
75
+
76
+ data = await self._request("POST", "/cn/index/fs/non_financial", json=payload)
77
+
78
+ # Flatten nested metrics (e.g. {"q": {"ps": {"toi": {"t": ...}}}})
79
+ flattened_data = [flatten_dict(item) for item in data]
80
+
81
+ return get_response_df(flattened_data, IndexNonFinancialStatementSchema)
82
+
83
+
84
+ # Functional API instance
85
+ _api_instance = IndexNonFinancialStatementAPI()
86
+
87
+
88
+ @api
89
+ async def get_index_non_financial_statements( # noqa: PLR0913
90
+ stock_codes: list[str],
91
+ metrics: list[str],
92
+ date: str | None = None,
93
+ start_date: str | None = None,
94
+ end_date: str | None = None,
95
+ limit: int | None = None,
96
+ ) -> pd.DataFrame:
97
+ """获取非金融类指数的财务报表数据.
98
+
99
+ Args:
100
+ stock_codes: 指数代码列表。
101
+ metrics: 指标列表。
102
+ date: 日期 (YYYY-MM-DD),与 start_date 二选一。
103
+ start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
104
+ end_date: 结束日期 (YYYY-MM-DD),可选。
105
+ limit: 返回最近数据的数量,仅在 date range 请求下生效。
106
+
107
+ Returns:
108
+ 包含非金融类指数财务报表数据的 DataFrame。
109
+
110
+ Example:
111
+ 获取中证白酒指数的营业总收入::
112
+
113
+ from lixinger import get_index_non_financial_statements
114
+
115
+ df = await get_index_non_financial_statements(
116
+ stock_codes=["000932"],
117
+ metrics=["q.ps.toi.t"],
118
+ date="2026-03-31",
119
+ )
120
+ print(df)
121
+
122
+ """
123
+ return await _api_instance.get_non_financial_statements(
124
+ stock_codes=stock_codes,
125
+ metrics=metrics,
126
+ date=date,
127
+ start_date=start_date,
128
+ end_date=end_date,
129
+ limit=limit,
130
+ )
@@ -0,0 +1,130 @@
1
+ """Index security 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.index.fs.security import IndexSecurityStatementSchema
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 IndexSecurityStatementAPI(BaseAPI):
15
+ """Index security 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
+ """获取证券类指数的财务报表数据.
27
+
28
+ API Endpoint: /cn/index/fs/security
29
+ API Method: POST
30
+ API Doc: https://www.lixinger.com/open/api/doc?api-key=cn/index/fs/security
31
+
32
+ 获取证券类大陆指数(样本仅包含证券公司)的财务数据,包括利润表、
33
+ 资产负债表、现金流量表、财务指标。
34
+
35
+ Args:
36
+ stock_codes: 指数代码列表,长度 >=1 且 <=100。当传入 start_date 时只能
37
+ 传入一个指数代码。
38
+ metrics: 指标列表,格式为 [granularity].[tableName].[fieldName].[expressionCalculateType],
39
+ 例如 ``"q.ps.toi.t"``。当 stock_codes 长度大于 1 时最多 48 个指标;
40
+ 等于 1 时最多 128 个指标。
41
+ date: 日期 (YYYY-MM-DD),与 start_date 二选一。支持 ``"latest"``。
42
+ start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
43
+ end_date: 结束日期 (YYYY-MM-DD),可选,默认上周一。
44
+ limit: 返回最近数据的数量,仅在 date range 请求下生效。
45
+
46
+ Returns:
47
+ 包含证券类指数财务报表数据的 DataFrame。
48
+
49
+ Example:
50
+ 获取证券公司指数的营业总收入::
51
+
52
+ from lixinger import AsyncLixingerClient
53
+
54
+ async with AsyncLixingerClient() as client:
55
+ df = await client.index.fs.security.get_security_statements(
56
+ stock_codes=["399975"],
57
+ metrics=["q.ps.toi.t"],
58
+ date="2026-03-31",
59
+ )
60
+ print(df)
61
+
62
+ """
63
+ payload: dict[str, Any] = {
64
+ "stockCodes": stock_codes,
65
+ "metricsList": metrics,
66
+ }
67
+ if date is not None:
68
+ payload["date"] = date
69
+ if start_date is not None:
70
+ payload["startDate"] = start_date
71
+ if end_date is not None:
72
+ payload["endDate"] = end_date
73
+ if limit is not None:
74
+ payload["limit"] = limit
75
+
76
+ data = await self._request("POST", "/cn/index/fs/security", json=payload)
77
+
78
+ # Flatten nested metrics
79
+ flattened_data = [flatten_dict(item) for item in data]
80
+
81
+ return get_response_df(flattened_data, IndexSecurityStatementSchema)
82
+
83
+
84
+ # Functional API instance
85
+ _api_instance = IndexSecurityStatementAPI()
86
+
87
+
88
+ @api
89
+ async def get_index_security_statements( # noqa: PLR0913
90
+ stock_codes: list[str],
91
+ metrics: list[str],
92
+ date: str | None = None,
93
+ start_date: str | None = None,
94
+ end_date: str | None = None,
95
+ limit: int | None = None,
96
+ ) -> pd.DataFrame:
97
+ """获取证券类指数的财务报表数据.
98
+
99
+ Args:
100
+ stock_codes: 指数代码列表。
101
+ metrics: 指标列表。
102
+ date: 日期 (YYYY-MM-DD),与 start_date 二选一。
103
+ start_date: 开始日期 (YYYY-MM-DD),与 date 二选一。
104
+ end_date: 结束日期 (YYYY-MM-DD),可选。
105
+ limit: 返回最近数据的数量,仅在 date range 请求下生效。
106
+
107
+ Returns:
108
+ 包含证券类指数财务报表数据的 DataFrame。
109
+
110
+ Example:
111
+ 获取证券公司指数的营业总收入::
112
+
113
+ from lixinger import get_index_security_statements
114
+
115
+ df = await get_index_security_statements(
116
+ stock_codes=["399975"],
117
+ metrics=["q.ps.toi.t"],
118
+ date="2026-03-31",
119
+ )
120
+ print(df)
121
+
122
+ """
123
+ return await _api_instance.get_security_statements(
124
+ stock_codes=stock_codes,
125
+ metrics=metrics,
126
+ date=date,
127
+ start_date=start_date,
128
+ end_date=end_date,
129
+ limit=limit,
130
+ )
@@ -4,11 +4,49 @@ from lixinger.api.cn.index.candlestick import IndexCandlestickAPI
4
4
  from lixinger.api.cn.index.constituent_weightings import ConstituentWeightingsAPI
5
5
  from lixinger.api.cn.index.constituents import ConstituentsAPI
6
6
  from lixinger.api.cn.index.drawdown import DrawdownAPI
7
+ from lixinger.api.cn.index.fs.bank import IndexBankStatementAPI
8
+ from lixinger.api.cn.index.fs.hybrid import IndexHybridStatementAPI
9
+ from lixinger.api.cn.index.fs.non_financial import IndexNonFinancialStatementAPI
10
+ from lixinger.api.cn.index.fs.security import IndexSecurityStatementAPI
7
11
  from lixinger.api.cn.index.fundamental import IndexFundamentalAPI
8
12
  from lixinger.api.cn.index.index import IndexAPI
9
13
  from lixinger.api.cn.index.tracking_fund import TrackingFundAPI
10
14
 
11
15
 
16
+ class IndexFSNamespace:
17
+ """Namespace for index financial statement APIs.
18
+
19
+ Groups all index financial statement APIs by index type:
20
+
21
+ - non_financial: Non-financial indices (非金融类指数)
22
+ - bank: Bank indices (银行类指数)
23
+ - security: Security indices (证券类指数)
24
+ - hybrid: Hybrid indices (混合型指数)
25
+
26
+ """
27
+
28
+ def __init__(
29
+ self,
30
+ non_financial: IndexNonFinancialStatementAPI,
31
+ bank: IndexBankStatementAPI,
32
+ security: IndexSecurityStatementAPI,
33
+ hybrid: IndexHybridStatementAPI,
34
+ ):
35
+ """Initialize the index financial statement namespace.
36
+
37
+ Args:
38
+ non_financial: Non-financial index statement API
39
+ bank: Bank index statement API
40
+ security: Security index statement API
41
+ hybrid: Hybrid index statement API
42
+
43
+ """
44
+ self.non_financial = non_financial
45
+ self.bank = bank
46
+ self.security = security
47
+ self.hybrid = hybrid
48
+
49
+
12
50
  class IndexNamespace:
13
51
  """Namespace for index-related APIs.
14
52
 
@@ -22,6 +60,11 @@ class IndexNamespace:
22
60
  - candlestick: Index candlestick data API (get_candlestick)
23
61
  - drawdown: Index drawdown data API (get_drawdown)
24
62
  - tracking_fund: Index tracking fund API (get_tracking_fund)
63
+ - fs: Index financial statement APIs (sub-APIs for different index types)
64
+ - fs.non_financial: Non-financial index statements
65
+ - fs.bank: Bank index statements
66
+ - fs.security: Security index statements
67
+ - fs.hybrid: Hybrid index statements
25
68
 
26
69
  """
27
70
 
@@ -34,6 +77,10 @@ class IndexNamespace:
34
77
  candlestick: IndexCandlestickAPI,
35
78
  drawdown: DrawdownAPI,
36
79
  tracking_fund: TrackingFundAPI,
80
+ fs_non_financial: IndexNonFinancialStatementAPI,
81
+ fs_bank: IndexBankStatementAPI,
82
+ fs_security: IndexSecurityStatementAPI,
83
+ fs_hybrid: IndexHybridStatementAPI,
37
84
  ):
38
85
  """Initialize the index namespace.
39
86
 
@@ -45,6 +92,10 @@ class IndexNamespace:
45
92
  candlestick: Index candlestick data API
46
93
  drawdown: Index drawdown data API
47
94
  tracking_fund: Index tracking fund API
95
+ fs_non_financial: Non-financial index statement API
96
+ fs_bank: Bank index statement API
97
+ fs_security: Security index statement API
98
+ fs_hybrid: Hybrid index statement API
48
99
 
49
100
  """
50
101
  self.index = index
@@ -54,6 +105,12 @@ class IndexNamespace:
54
105
  self.candlestick = candlestick
55
106
  self.drawdown = drawdown
56
107
  self.tracking_fund = tracking_fund
108
+ self.fs = IndexFSNamespace(
109
+ non_financial=fs_non_financial,
110
+ bank=fs_bank,
111
+ security=fs_security,
112
+ hybrid=fs_hybrid,
113
+ )
57
114
 
58
115
  # Convenience aliases for shorter access
59
116
  def get_index(self, *args, **kwargs):
lixinger/client.py CHANGED
@@ -28,8 +28,12 @@ from lixinger.api.cn.index import (
28
28
  ConstituentWeightingsAPI,
29
29
  DrawdownAPI,
30
30
  IndexAPI,
31
+ IndexBankStatementAPI,
31
32
  IndexCandlestickAPI,
32
33
  IndexFundamentalAPI,
34
+ IndexHybridStatementAPI,
35
+ IndexNonFinancialStatementAPI,
36
+ IndexSecurityStatementAPI,
33
37
  TrackingFundAPI,
34
38
  )
35
39
  from lixinger.api.cn.index.namespace import IndexNamespace
@@ -166,6 +170,10 @@ class AsyncLixingerClient:
166
170
  cn_index_drawdown = DrawdownAPI(self._http_client, self.config, self._rate_limiter)
167
171
  cn_index_fundamental = IndexFundamentalAPI(self._http_client, self.config, self._rate_limiter)
168
172
  cn_index_tracking_fund = TrackingFundAPI(self._http_client, self.config, self._rate_limiter)
173
+ cn_index_fs_non_financial = IndexNonFinancialStatementAPI(self._http_client, self.config, self._rate_limiter)
174
+ cn_index_fs_bank = IndexBankStatementAPI(self._http_client, self.config, self._rate_limiter)
175
+ cn_index_fs_security = IndexSecurityStatementAPI(self._http_client, self.config, self._rate_limiter)
176
+ cn_index_fs_hybrid = IndexHybridStatementAPI(self._http_client, self.config, self._rate_limiter)
169
177
 
170
178
  # Index namespace (groups all index APIs)
171
179
  self.cn_index = IndexNamespace(
@@ -176,6 +184,10 @@ class AsyncLixingerClient:
176
184
  candlestick=cn_index_candlestick,
177
185
  drawdown=cn_index_drawdown,
178
186
  tracking_fund=cn_index_tracking_fund,
187
+ fs_non_financial=cn_index_fs_non_financial,
188
+ fs_bank=cn_index_fs_bank,
189
+ fs_security=cn_index_fs_security,
190
+ fs_hybrid=cn_index_fs_hybrid,
179
191
  )
180
192
 
181
193
  # Legacy flat access for index APIs (deprecated, for backward compatibility)
@@ -185,6 +197,10 @@ class AsyncLixingerClient:
185
197
  self.cn_index_drawdown = cn_index_drawdown
186
198
  self.cn_index_fundamental = cn_index_fundamental
187
199
  self.cn_index_tracking_fund = cn_index_tracking_fund
200
+ self.cn_index_fs_non_financial = cn_index_fs_non_financial
201
+ self.cn_index_fs_bank = cn_index_fs_bank
202
+ self.cn_index_fs_security = cn_index_fs_security
203
+ self.cn_index_fs_hybrid = cn_index_fs_hybrid
188
204
 
189
205
  # Fund APIs
190
206
  self.cn_fund = FundAPI(self._http_client, self.config, self._rate_limiter)
@@ -4,6 +4,12 @@ from lixinger.models.cn.index.candlestick import IndexCandlestick
4
4
  from lixinger.models.cn.index.constituent_weightings import ConstituentWeighting
5
5
  from lixinger.models.cn.index.constituents import Constituent
6
6
  from lixinger.models.cn.index.drawdown import IndexDrawdown
7
+ from lixinger.models.cn.index.fs import (
8
+ IndexBankStatementSchema,
9
+ IndexHybridStatementSchema,
10
+ IndexNonFinancialStatementSchema,
11
+ IndexSecurityStatementSchema,
12
+ )
7
13
  from lixinger.models.cn.index.fundamental import IndexFundamentalData
8
14
  from lixinger.models.cn.index.index import Index
9
15
  from lixinger.models.cn.index.tracking_fund import TrackingFund
@@ -16,4 +22,9 @@ __all__ = [
16
22
  "IndexDrawdown",
17
23
  "IndexFundamentalData",
18
24
  "TrackingFund",
25
+ # Index financial statements
26
+ "IndexBankStatementSchema",
27
+ "IndexHybridStatementSchema",
28
+ "IndexNonFinancialStatementSchema",
29
+ "IndexSecurityStatementSchema",
19
30
  ]
@@ -0,0 +1,13 @@
1
+ """Index financial statement models."""
2
+
3
+ from lixinger.models.cn.index.fs.bank import IndexBankStatementSchema
4
+ from lixinger.models.cn.index.fs.hybrid import IndexHybridStatementSchema
5
+ from lixinger.models.cn.index.fs.non_financial import IndexNonFinancialStatementSchema
6
+ from lixinger.models.cn.index.fs.security import IndexSecurityStatementSchema
7
+
8
+ __all__ = [
9
+ "IndexBankStatementSchema",
10
+ "IndexHybridStatementSchema",
11
+ "IndexNonFinancialStatementSchema",
12
+ "IndexSecurityStatementSchema",
13
+ ]
@@ -0,0 +1,20 @@
1
+ """Index bank statement models."""
2
+
3
+ import pandera.pandas as pa
4
+
5
+
6
+ class IndexBankStatementSchema(pa.DataFrameModel):
7
+ """Index bank 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
+ """Index hybrid statement models."""
2
+
3
+ import pandera.pandas as pa
4
+
5
+
6
+ class IndexHybridStatementSchema(pa.DataFrameModel):
7
+ """Index hybrid 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
+ """Index non-financial statement models."""
2
+
3
+ import pandera.pandas as pa
4
+
5
+
6
+ class IndexNonFinancialStatementSchema(pa.DataFrameModel):
7
+ """Index non-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
+ """Index security statement models."""
2
+
3
+ import pandera.pandas as pa
4
+
5
+
6
+ class IndexSecurityStatementSchema(pa.DataFrameModel):
7
+ """Index security 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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lixinger-python
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: Python SDK for Lixinger Financial Data API
5
5
  Project-URL: Homepage, https://www.lixinger.com
6
6
  Project-URL: Documentation, https://www.lixinger.com/open/api/doc
@@ -1,5 +1,5 @@
1
- lixinger/__init__.py,sha256=_W43coEZ9iVNFec80S_uRcYYkSkgLuvq3PaPLFj16qU,2126
2
- lixinger/client.py,sha256=aaYJfOjc9-IxqGe1LqiXtR6ldUNrqoorMSg67TbUA0A,10333
1
+ lixinger/__init__.py,sha256=WhuTjjENkj2h5Qr66PNfv41AGV6hKNdGi87borIqeBw,2445
2
+ lixinger/client.py,sha256=djI2Lf4a09Vkdm7ManJs4WVP_cDS-_coqT3h2Eg4UHc,11296
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
@@ -31,15 +31,20 @@ lixinger/api/cn/fund/candlestick.py,sha256=XdkxjtjIT1ixNzOArJRKBvlabTHz3PA9w2zsG
31
31
  lixinger/api/cn/fund/fund.py,sha256=Y1ysdyl1zpu71iiFR4G6ixqBT4Kb9PxSWk_oFpFVeMI,1624
32
32
  lixinger/api/cn/fund/profile.py,sha256=kTbqmz3obYRNjFjkD74I-R3x0SBsZCqI0KPjiWe84QI,1347
33
33
  lixinger/api/cn/fund/shareholdings.py,sha256=aGFsyBiIW-wsbpAnwnAnRY6duiBKeYbQVKfpdQXs3tY,2358
34
- lixinger/api/cn/index/__init__.py,sha256=T1vGReTsHm9l-nCp0H_Um0nCQcNb7y0KR9gGVh--xQs,982
34
+ lixinger/api/cn/index/__init__.py,sha256=IylYWSnDd5KD5HbTAoiJRgBkasYf53YurKxf5pFwdgc,1594
35
35
  lixinger/api/cn/index/candlestick.py,sha256=MdFGWf3pSoqPtzkCQJbSY1b6vw1nmZ6lKmgxdFMIMlo,2356
36
36
  lixinger/api/cn/index/constituent_weightings.py,sha256=UuAmqhgapMAMW6qZge3yKb9E9h7WNuZZ83sLkZIq-rA,3352
37
37
  lixinger/api/cn/index/constituents.py,sha256=8kQjTJER8PqpZMTQWusDK9mbQ27YLYgYxw8u_vHqsy4,3372
38
38
  lixinger/api/cn/index/drawdown.py,sha256=D-fhA-Sv2-gf6VzX0zG1dm7Tn5Wy7NK1IB-f5kFXi7w,2450
39
39
  lixinger/api/cn/index/fundamental.py,sha256=MyhGmMk7GkOZflpT0JMoiLsCs3DLMLLkopyUsD94Y4Q,2474
40
40
  lixinger/api/cn/index/index.py,sha256=5gDwE5K3tYNlCrV-EsSC4HXhfIi58uqWpHQxTt9LJMk,4177
41
- lixinger/api/cn/index/namespace.py,sha256=YoxOwbA3_8o4iUvqIRWFPIBnvkF3PfToelBy1aWPkkw,3431
41
+ lixinger/api/cn/index/namespace.py,sha256=pzYkQzYqu5TASTZxk5IQJDqt2U7oTbTzwBErfp2aKxE,5559
42
42
  lixinger/api/cn/index/tracking_fund.py,sha256=su0zJRROKuTZlHe0XkIQz8kJOyPZmyg7HxZIbmpM_YM,1960
43
+ lixinger/api/cn/index/fs/__init__.py,sha256=eQTxjzZfiqxDU8WdLA-deAtus-nYEiO2mLq2gOkFTts,1060
44
+ lixinger/api/cn/index/fs/bank.py,sha256=zjDB_d06E_gxAvVNyk9Byoa5ShlevNoc75z5gVBH6aY,4416
45
+ lixinger/api/cn/index/fs/hybrid.py,sha256=qs25ZXdCBiIRQ3mm2yyXQngSGtLIs1W93nvRxQDubIE,4429
46
+ lixinger/api/cn/index/fs/non_financial.py,sha256=XlP9Jl5bHUto6mybj4WGCb11LjYINzwYhJaG_WEHYww,4599
47
+ lixinger/api/cn/index/fs/security.py,sha256=l1Raf8GuYpthRDgNSMnVjDn9AcKLG5qP-wVKMd4GKQw,4458
43
48
  lixinger/models/__init__.py,sha256=OAUYpI_JaGZExFqZ0H6l8fJ5qyLW0oFnnO4JGJQknTE,154
44
49
  lixinger/models/cn/__init__.py,sha256=mhTq_PfPJ_0720E1rTKdqBTpb9A14_ZDDWLfJXjcVck,27
45
50
  lixinger/models/cn/company/__init__.py,sha256=7E7p1NED5qr0yf_wcmOq_DDvOq2hzXv3bD4cLjHTtSQ,957
@@ -65,7 +70,7 @@ lixinger/models/cn/fund/candlestick.py,sha256=JSmEPTIB992Mujb6qBBX3NUTq9tafoJdNh
65
70
  lixinger/models/cn/fund/fund.py,sha256=IQQJic7dL58eM00E6DDY9beePpqJSqxu6E1DW0-X3iY,762
66
71
  lixinger/models/cn/fund/profile.py,sha256=j02zgDXdFC9zLPcEgNKpoxIeHLac27ySngU6Vikh_V4,1202
67
72
  lixinger/models/cn/fund/shareholdings.py,sha256=67cJfRGBjMRwI6f1RQbg-Hnb-SK620gKIphvCdjNzOk,611
68
- lixinger/models/cn/index/__init__.py,sha256=bDSqijHQ_DskEpSp4qZzrKdAw9gCM6cwEd87Z_cJrRM,649
73
+ lixinger/models/cn/index/__init__.py,sha256=NxxKPPv3qg-nVA3UHmWIbKLaMKTKHBcc01PyWcq7P7s,1002
69
74
  lixinger/models/cn/index/candlestick.py,sha256=So3ArqKge-reoeAn5E26I1fQusPks6jtvfHVNKF_yY0,560
70
75
  lixinger/models/cn/index/constituent_weightings.py,sha256=Vr68TyJ6mjXtKMUD-d_daG2CR1GJ60ipAfK-HhdXZVo,370
71
76
  lixinger/models/cn/index/constituents.py,sha256=UDVCoQsKahMhlF9Os-Xgo0XRg6dfH5WBBiOuQMlPqz8,371
@@ -73,13 +78,18 @@ lixinger/models/cn/index/drawdown.py,sha256=kvrhy7_fIjvUHXFTUn3TXqSNip7vZXpfWjly
73
78
  lixinger/models/cn/index/fundamental.py,sha256=4gBOFADCq1C0pcSa9JfxDkH-3spRErkg3LwVJyYrGvU,374
74
79
  lixinger/models/cn/index/index.py,sha256=M_ZYGGfcpWXrmwhz58HfojInsmAUQeZSNJ74sAqTbqA,842
75
80
  lixinger/models/cn/index/tracking_fund.py,sha256=qbsdMlD0FBpWDBWS8smOeqK_hJOp8OzkT2NA0Zn_k-s,424
81
+ lixinger/models/cn/index/fs/__init__.py,sha256=CMHJ7UaslJYuUkynpd_yADsP8gsNFEOS67kng5Ryvok,507
82
+ lixinger/models/cn/index/fs/bank.py,sha256=DA_sRFSsK5IE0JQtp3pHdvPJQxbipHsSyKahcBbaZ-U,559
83
+ lixinger/models/cn/index/fs/hybrid.py,sha256=AlCoEfkkPdWGxE_K71rBKgwWpR4iWTaMJ8bc56YxYrk,565
84
+ lixinger/models/cn/index/fs/non_financial.py,sha256=UpWXDDMiOdJN6WNc5R-PsHy9l9Th3xsKnOjUbID4Gug,585
85
+ lixinger/models/cn/index/fs/security.py,sha256=VTYDvTQ5CKhqZsXeEyWqFNvugZ4UA3CLW0DkYTrOHtc,571
76
86
  lixinger/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
77
87
  lixinger/utils/api.py,sha256=BktR40JtKCMe9excFWo4ujsq3GiQK4ypJLG3MpJgo2s,402
78
88
  lixinger/utils/dataframe.py,sha256=tYBrNdmJ4poyuwD-9XgzHt3A_A8bBo0cdHiu8Yy9e9A,2208
79
89
  lixinger/utils/dict.py,sha256=yvbUtv8QpRmy0d_o_7gCuEwwiEfBji5_xB490ANxilw,589
80
90
  lixinger/utils/rate_limiter.py,sha256=DCaG87kIjDU5triYHU33-FW7h6KsbELBnU9f6mCQKCU,1133
81
91
  lixinger/utils/retry.py,sha256=sXtb0ESp12_JedjzDxoeIH48TlOrbxtIA0j1V33DW7M,1026
82
- lixinger_python-0.3.6.dist-info/METADATA,sha256=aT8MpJ92JR865fQkw2Zf4ex0l8HfTy4zioD-xkYMjuw,9206
83
- lixinger_python-0.3.6.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
84
- lixinger_python-0.3.6.dist-info/licenses/LICENSE,sha256=5oOwRq1lHSOScbNGCHr2feuNnhNYdGcArj6fSUfsC5U,1064
85
- lixinger_python-0.3.6.dist-info/RECORD,,
92
+ lixinger_python-0.3.7.dist-info/METADATA,sha256=Kom1Z2xPM3d87I39ccLzH4zTSz_Vwc-UZohr9DZqAhQ,9206
93
+ lixinger_python-0.3.7.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
94
+ lixinger_python-0.3.7.dist-info/licenses/LICENSE,sha256=5oOwRq1lHSOScbNGCHr2feuNnhNYdGcArj6fSUfsC5U,1064
95
+ lixinger_python-0.3.7.dist-info/RECORD,,