lixinger-python 0.3.0__py3-none-any.whl → 0.3.1__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.
@@ -14,27 +14,47 @@ class DividendAPI(BaseAPI):
14
14
  async def get_dividend(
15
15
  self,
16
16
  stock_code: str,
17
- start_date: str | None = None,
17
+ start_date: str,
18
18
  end_date: str | None = None,
19
+ limit: int | None = None,
19
20
  ) -> pd.DataFrame:
20
21
  """获取分红数据.
21
22
 
22
23
  API Endpoint: /cn/company/dividend
23
24
  API Method: POST
25
+ Documentation: https://www.lixinger.com/open/api/doc?api-key=cn/company/dividend
24
26
 
25
27
  Args:
26
28
  stock_code: 股票代码
27
- start_date: 开始日期 (YYYY-MM-DD)
28
- end_date: 结束日期 (YYYY-MM-DD)
29
+ start_date: 开始日期 (YYYY-MM-DD), 必填。起始时间和结束时间间隔不超过10年
30
+ end_date: 结束日期 (YYYY-MM-DD), 可选。默认值是上周一
31
+ limit: 返回最近数据的数量, 可选
32
+
33
+ Returns:
34
+ 包含分红数据的 DataFrame
35
+
36
+ Example:
37
+ 获取分红数据::
38
+
39
+ from lixinger import AsyncLixingerClient
40
+
41
+ async with AsyncLixingerClient() as client:
42
+ df = await client.company.dividend.get_dividend(
43
+ stock_code="600036",
44
+ start_date="2023-01-01",
45
+ end_date="2024-01-01"
46
+ )
47
+ print(df)
29
48
 
30
49
  """
31
50
  payload: dict[str, Any] = {
32
51
  "stockCode": stock_code,
52
+ "startDate": start_date,
33
53
  }
34
- if start_date is not None:
35
- payload["startDate"] = start_date
36
54
  if end_date is not None:
37
55
  payload["endDate"] = end_date
56
+ if limit is not None:
57
+ payload["limit"] = limit
38
58
 
39
59
  data = await self._request("POST", "/cn/company/dividend", json=payload)
40
60
  for item in data:
@@ -49,19 +69,25 @@ _api_instance = DividendAPI()
49
69
  @api
50
70
  async def get_dividend(
51
71
  stock_code: str,
52
- start_date: str | None = None,
72
+ start_date: str,
53
73
  end_date: str | None = None,
74
+ limit: int | None = None,
54
75
  ) -> pd.DataFrame:
55
76
  """获取分红数据.
56
77
 
57
78
  Args:
58
79
  stock_code: 股票代码
59
- start_date: 开始日期 (YYYY-MM-DD)
60
- end_date: 结束日期 (YYYY-MM-DD)
80
+ start_date: 开始日期 (YYYY-MM-DD), 必填。起始时间和结束时间间隔不超过10年
81
+ end_date: 结束日期 (YYYY-MM-DD), 可选。默认值是上周一
82
+ limit: 返回最近数据的数量, 可选
83
+
84
+ Returns:
85
+ 包含分红数据的 DataFrame
61
86
 
62
87
  """
63
88
  return await _api_instance.get_dividend(
64
89
  stock_code=stock_code,
65
90
  start_date=start_date,
66
91
  end_date=end_date,
92
+ limit=limit,
67
93
  )
@@ -4,7 +4,27 @@ import pandera.pandas as pa
4
4
 
5
5
 
6
6
  class Dividend(pa.DataFrameModel):
7
- """Dividend data model."""
7
+ """Dividend data model.
8
+
9
+ API文档: https://www.lixinger.com/open/api/doc?api-key=cn/company/dividend
10
+
11
+ Attributes:
12
+ date: 公告日期
13
+ content: 内容
14
+ bonus_shares_from_profit: 送股(股)
15
+ bonus_shares_from_capital_reserve: 转增(股)
16
+ dividend: 分红
17
+ currency: 货币
18
+ dividend_amount: 分红金额
19
+ annual_net_profit: 年度净利润
20
+ annual_net_profit_dividend_ratio: 年度净利润分红比例
21
+ register_date: 股权登记日
22
+ ex_date: 除权除息日
23
+ payment_date: 分红到账日
24
+ fs_end_date: 财报时间
25
+ stock_code: 股票代码(由SDK添加)
26
+
27
+ """
8
28
 
9
29
  class Config:
10
30
  """Pandera configuration."""
@@ -12,14 +32,20 @@ class Dividend(pa.DataFrameModel):
12
32
  coerce = True
13
33
  strict = False
14
34
 
35
+ # 必填字段
15
36
  date: pa.typing.Series[pa.typing.DateTime]
16
37
  fs_end_date: pa.typing.Series[pa.typing.DateTime]
17
38
  currency: pa.typing.Series[str]
18
39
  bonus_shares_from_profit: pa.typing.Series[float]
19
40
  bonus_shares_from_capital_reserve: pa.typing.Series[float]
20
41
  dividend: pa.typing.Series[float]
42
+ stock_code: pa.typing.Series[str]
43
+
44
+ # 可选字段
45
+ content: pa.typing.Series[str] | None = pa.Field(nullable=True)
21
46
  register_date: pa.typing.Series[pa.typing.DateTime] | None = pa.Field(nullable=True)
22
47
  ex_date: pa.typing.Series[pa.typing.DateTime] | None = pa.Field(nullable=True)
23
48
  payment_date: pa.typing.Series[pa.typing.DateTime] | None = pa.Field(nullable=True)
24
49
  dividend_amount: pa.typing.Series[float] | None = pa.Field(nullable=True)
25
- stock_code: pa.typing.Series[str]
50
+ annual_net_profit: pa.typing.Series[float] | None = pa.Field(nullable=True)
51
+ annual_net_profit_dividend_ratio: pa.typing.Series[float] | None = pa.Field(nullable=True)
@@ -1,6 +1,6 @@
1
1
  """Security fundamental data models."""
2
2
 
3
- import pandera as pa
3
+ import pandera.pandas as pa
4
4
 
5
5
 
6
6
  class SecurityFundamentalSchema(pa.DataFrameModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lixinger-python
3
- Version: 0.3.0
3
+ Version: 0.3.1
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
@@ -10,7 +10,7 @@ lixinger/api/cn/company/__init__.py,sha256=K8aNp2gGj4iQOvc8KjXA5668QUAhwyTfMBPhP
10
10
  lixinger/api/cn/company/announcement.py,sha256=lYt4AWOV5b9OTKfvJ7ZOqWP61pcPcyIQzb5N2DqFT6k,1920
11
11
  lixinger/api/cn/company/candlestick.py,sha256=VRG5ZPyVNYLvdCcCxB3wjzrpVXYK2M5-x5xprTpp1fU,2132
12
12
  lixinger/api/cn/company/company.py,sha256=D6yhmFPzhdWadBsNka-8h4mkbKjD4HoBFQCw72hTWnY,2904
13
- lixinger/api/cn/company/dividend.py,sha256=yLOz-nhrR0CC5XqrdZe0vTAFSr0wDCVf_57SVS__2sI,1656
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
16
  lixinger/api/cn/company/namespace.py,sha256=qNyzM0qHwf9sJUTSZpb-_gaJYpT62oTUJinJzYpC7RE,5117
@@ -45,7 +45,7 @@ lixinger/models/cn/company/__init__.py,sha256=7E7p1NED5qr0yf_wcmOq_DDvOq2hzXv3bD
45
45
  lixinger/models/cn/company/announcement.py,sha256=VBtsxP6Cpi-w2H-iciByj_rFm1dMzaI09zEV1QQxOyI,468
46
46
  lixinger/models/cn/company/candlestick.py,sha256=TfvdySyPBxU8l-sHH1xQq20wKoslKNeLECdyasRPrb8,674
47
47
  lixinger/models/cn/company/company.py,sha256=BJRUWLifoxMVN3umOw99t8thaFcuwK244Hv_CDogH4w,933
48
- lixinger/models/cn/company/dividend.py,sha256=Tc0LDxRnoHh_jH5PJLqDGOiHufp36xw5Nxbt1iVsvJQ,896
48
+ lixinger/models/cn/company/dividend.py,sha256=NxVIP9iCw7Imat76in03iKRQsEfgmLkSBD1YgNXvu2Y,1831
49
49
  lixinger/models/cn/company/equity_change.py,sha256=8I0u8Jkfj-bnIpQi_0YHpYhrPK-1X0BON_9YcIbLVzk,860
50
50
  lixinger/models/cn/company/indices.py,sha256=Dxi_lAZPEWy3evcUHArsST0oTmJHyYAcT2Y8suqZQdc,349
51
51
  lixinger/models/cn/company/fs/__init__.py,sha256=qYUQzRdsr7vvyczQ-79ntZvRkHQWSnkQxIXWA81-nqA,162
@@ -55,7 +55,7 @@ lixinger/models/cn/company/fundamental/bank.py,sha256=CvqEfU3btDWlphJTDWMxlUyTiA
55
55
  lixinger/models/cn/company/fundamental/insurance.py,sha256=-bP3VeKr-0yYvGuZnolCxvoU9R4Yg3-w8czskWUpK1g,404
56
56
  lixinger/models/cn/company/fundamental/non_financial.py,sha256=oIe_xDAQRwLdHjjdIQKe9u-plC7IbiUiAekG73d7WTw,415
57
57
  lixinger/models/cn/company/fundamental/other_financial.py,sha256=FWpX9lk22-UhV6RVIySpsKL1I2tlDRyxdj2s9ORsGLo,421
58
- lixinger/models/cn/company/fundamental/security.py,sha256=V-fZKh7Djx2WNDR7a2qKkuHTNpoUAGWz6tjfJtr8VcI,378
58
+ lixinger/models/cn/company/fundamental/security.py,sha256=W0ppyeftEHQrjidymOfLS96WWdWjb4IuwqM22Fx7wV4,385
59
59
  lixinger/models/cn/fund/__init__.py,sha256=V_RlPF8F8xZxazWtec8RHcOlFUh4w10VPVKTAXn2o0k,643
60
60
  lixinger/models/cn/fund/announcement.py,sha256=T8tUGpI7wo_l5tuf6QnY8AMbnFAKEtrcI1jfSKoQzsA,510
61
61
  lixinger/models/cn/fund/asset_combination.py,sha256=b7O-tisxT-qnAFc_tKnOLNhYJZWp0InMB7t22lT9xC4,1538
@@ -78,7 +78,7 @@ lixinger/utils/dataframe.py,sha256=tYBrNdmJ4poyuwD-9XgzHt3A_A8bBo0cdHiu8Yy9e9A,2
78
78
  lixinger/utils/dict.py,sha256=yvbUtv8QpRmy0d_o_7gCuEwwiEfBji5_xB490ANxilw,589
79
79
  lixinger/utils/rate_limiter.py,sha256=DCaG87kIjDU5triYHU33-FW7h6KsbELBnU9f6mCQKCU,1133
80
80
  lixinger/utils/retry.py,sha256=sXtb0ESp12_JedjzDxoeIH48TlOrbxtIA0j1V33DW7M,1026
81
- lixinger_python-0.3.0.dist-info/METADATA,sha256=m_4juF4m8xmZjUXRIyh3ZRSrtZ63-xop8SJTwlR-r3U,9209
82
- lixinger_python-0.3.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
83
- lixinger_python-0.3.0.dist-info/licenses/LICENSE,sha256=5oOwRq1lHSOScbNGCHr2feuNnhNYdGcArj6fSUfsC5U,1064
84
- lixinger_python-0.3.0.dist-info/RECORD,,
81
+ lixinger_python-0.3.1.dist-info/METADATA,sha256=ARvpZpgTIiH3Y9d2jWFoW-VwZ6tdMm_tQyOti4AuQc0,9209
82
+ lixinger_python-0.3.1.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
83
+ lixinger_python-0.3.1.dist-info/licenses/LICENSE,sha256=5oOwRq1lHSOScbNGCHr2feuNnhNYdGcArj6fSUfsC5U,1064
84
+ lixinger_python-0.3.1.dist-info/RECORD,,