lixinger-python 0.3.9__py3-none-any.whl → 0.3.10__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/api/base.py +1 -1
- lixinger/api/cn/company/namespace.py +3 -3
- lixinger/api/cn/index/namespace.py +22 -18
- lixinger/client.py +11 -4
- lixinger/exceptions.py +1 -1
- lixinger/utils/rate_limiter.py +1 -1
- {lixinger_python-0.3.9.dist-info → lixinger_python-0.3.10.dist-info}/METADATA +1 -1
- {lixinger_python-0.3.9.dist-info → lixinger_python-0.3.10.dist-info}/RECORD +10 -10
- {lixinger_python-0.3.9.dist-info → lixinger_python-0.3.10.dist-info}/WHEEL +0 -0
- {lixinger_python-0.3.9.dist-info → lixinger_python-0.3.10.dist-info}/licenses/LICENSE +0 -0
lixinger/api/base.py
CHANGED
|
@@ -37,7 +37,7 @@ class BaseAPI:
|
|
|
37
37
|
client: httpx.AsyncClient | None = None,
|
|
38
38
|
config: Config | None = None,
|
|
39
39
|
rate_limiter: AsyncRateLimiter | None = None,
|
|
40
|
-
):
|
|
40
|
+
) -> None:
|
|
41
41
|
self._client = client
|
|
42
42
|
self._config = config or settings
|
|
43
43
|
self._rate_limiter = rate_limiter or _global_rate_limiter
|
|
@@ -37,7 +37,7 @@ class FundamentalNamespace:
|
|
|
37
37
|
insurance: InsuranceFundamentalAPI,
|
|
38
38
|
security: SecurityFundamentalAPI,
|
|
39
39
|
other_financial: OtherFinancialFundamentalAPI,
|
|
40
|
-
):
|
|
40
|
+
) -> None:
|
|
41
41
|
"""Initialize the fundamental namespace."""
|
|
42
42
|
self.non_financial = non_financial
|
|
43
43
|
self.bank = bank
|
|
@@ -65,7 +65,7 @@ class FSNamespace:
|
|
|
65
65
|
insurance: InsuranceStatementAPI,
|
|
66
66
|
security: SecurityStatementAPI,
|
|
67
67
|
other_financial: OtherFinancialStatementAPI,
|
|
68
|
-
):
|
|
68
|
+
) -> None:
|
|
69
69
|
"""Initialize the financial statement namespace."""
|
|
70
70
|
self.non_financial = non_financial
|
|
71
71
|
self.bank = bank
|
|
@@ -121,7 +121,7 @@ class CompanyNamespace:
|
|
|
121
121
|
indices: IndicesAPI,
|
|
122
122
|
dividend: DividendAPI,
|
|
123
123
|
announcement: AnnouncementAPI,
|
|
124
|
-
):
|
|
124
|
+
) -> None:
|
|
125
125
|
"""Initialize the company namespace.
|
|
126
126
|
|
|
127
127
|
Args:
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"""Index namespace for grouping related APIs."""
|
|
2
2
|
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
import pandas as pd
|
|
6
|
+
|
|
3
7
|
from lixinger.api.cn.index.candlestick import IndexCandlestickAPI
|
|
4
8
|
from lixinger.api.cn.index.constituent_weightings import ConstituentWeightingsAPI
|
|
5
9
|
from lixinger.api.cn.index.constituents import ConstituentsAPI
|
|
@@ -32,7 +36,7 @@ class IndexFSNamespace:
|
|
|
32
36
|
bank: IndexBankStatementAPI,
|
|
33
37
|
security: IndexSecurityStatementAPI,
|
|
34
38
|
hybrid: IndexHybridStatementAPI,
|
|
35
|
-
):
|
|
39
|
+
) -> None:
|
|
36
40
|
"""Initialize the index financial statement namespace.
|
|
37
41
|
|
|
38
42
|
Args:
|
|
@@ -84,7 +88,7 @@ class IndexNamespace:
|
|
|
84
88
|
fs_bank: IndexBankStatementAPI,
|
|
85
89
|
fs_security: IndexSecurityStatementAPI,
|
|
86
90
|
fs_hybrid: IndexHybridStatementAPI,
|
|
87
|
-
):
|
|
91
|
+
) -> None:
|
|
88
92
|
"""Initialize the index namespace.
|
|
89
93
|
|
|
90
94
|
Args:
|
|
@@ -118,34 +122,34 @@ class IndexNamespace:
|
|
|
118
122
|
)
|
|
119
123
|
|
|
120
124
|
# Convenience aliases for shorter access
|
|
121
|
-
def get_index(self, *args, **kwargs):
|
|
125
|
+
async def get_index(self, *args: Any, **kwargs: Any) -> pd.DataFrame:
|
|
122
126
|
"""Alias for index.get_index."""
|
|
123
|
-
return self.index.get_index(*args, **kwargs)
|
|
127
|
+
return await self.index.get_index(*args, **kwargs)
|
|
124
128
|
|
|
125
|
-
def get_constituents(self, *args, **kwargs):
|
|
129
|
+
async def get_constituents(self, *args: Any, **kwargs: Any) -> pd.DataFrame:
|
|
126
130
|
"""Alias for constituents.get_constituents."""
|
|
127
|
-
return self.constituents.get_constituents(*args, **kwargs)
|
|
131
|
+
return await self.constituents.get_constituents(*args, **kwargs)
|
|
128
132
|
|
|
129
|
-
def get_constituent_weightings(self, *args, **kwargs):
|
|
133
|
+
async def get_constituent_weightings(self, *args: Any, **kwargs: Any) -> pd.DataFrame:
|
|
130
134
|
"""Alias for constituent_weightings.get_constituent_weightings."""
|
|
131
|
-
return self.constituent_weightings.get_constituent_weightings(*args, **kwargs)
|
|
135
|
+
return await self.constituent_weightings.get_constituent_weightings(*args, **kwargs)
|
|
132
136
|
|
|
133
|
-
def get_fundamental(self, *args, **kwargs):
|
|
137
|
+
async def get_fundamental(self, *args: Any, **kwargs: Any) -> pd.DataFrame:
|
|
134
138
|
"""Alias for fundamental.get_fundamental."""
|
|
135
|
-
return self.fundamental.get_fundamental(*args, **kwargs)
|
|
139
|
+
return await self.fundamental.get_fundamental(*args, **kwargs)
|
|
136
140
|
|
|
137
|
-
def get_candlestick(self, *args, **kwargs):
|
|
141
|
+
async def get_candlestick(self, *args: Any, **kwargs: Any) -> pd.DataFrame:
|
|
138
142
|
"""Alias for candlestick.get_candlestick."""
|
|
139
|
-
return self.candlestick.get_candlestick(*args, **kwargs)
|
|
143
|
+
return await self.candlestick.get_candlestick(*args, **kwargs)
|
|
140
144
|
|
|
141
|
-
def get_drawdown(self, *args, **kwargs):
|
|
145
|
+
async def get_drawdown(self, *args: Any, **kwargs: Any) -> pd.DataFrame:
|
|
142
146
|
"""Alias for drawdown.get_drawdown."""
|
|
143
|
-
return self.drawdown.get_drawdown(*args, **kwargs)
|
|
147
|
+
return await self.drawdown.get_drawdown(*args, **kwargs)
|
|
144
148
|
|
|
145
|
-
def get_tracking_fund(self, *args, **kwargs):
|
|
149
|
+
async def get_tracking_fund(self, *args: Any, **kwargs: Any) -> pd.DataFrame:
|
|
146
150
|
"""Alias for tracking_fund.get_tracking_fund."""
|
|
147
|
-
return self.tracking_fund.get_tracking_fund(*args, **kwargs)
|
|
151
|
+
return await self.tracking_fund.get_tracking_fund(*args, **kwargs)
|
|
148
152
|
|
|
149
|
-
def get_margin_trading(self, *args, **kwargs):
|
|
153
|
+
async def get_margin_trading(self, *args: Any, **kwargs: Any) -> pd.DataFrame:
|
|
150
154
|
"""Alias for margin_trading.get_margin_trading."""
|
|
151
|
-
return self.margin_trading.get_margin_trading(*args, **kwargs)
|
|
155
|
+
return await self.margin_trading.get_margin_trading(*args, **kwargs)
|
lixinger/client.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from types import TracebackType
|
|
2
|
+
|
|
1
3
|
import httpx
|
|
2
4
|
|
|
3
5
|
from lixinger.api.cn.company.announcement import AnnouncementAPI
|
|
@@ -62,7 +64,7 @@ class AsyncLixingerClient:
|
|
|
62
64
|
max_retries: int | None = None,
|
|
63
65
|
proxy: str | None = None,
|
|
64
66
|
max_requests_per_minute: int = 1000,
|
|
65
|
-
):
|
|
67
|
+
) -> None:
|
|
66
68
|
"""Initialize the async Lixinger API client.
|
|
67
69
|
|
|
68
70
|
The API key is ALWAYS loaded from the LIXINGER_API_KEY environment variable.
|
|
@@ -233,13 +235,18 @@ class AsyncLixingerClient:
|
|
|
233
235
|
)
|
|
234
236
|
self.cn_fund_announcement = FundAnnouncementAPI(self._http_client, self.config, self._rate_limiter)
|
|
235
237
|
|
|
236
|
-
async def __aenter__(self):
|
|
238
|
+
async def __aenter__(self) -> "AsyncLixingerClient":
|
|
237
239
|
return self
|
|
238
240
|
|
|
239
|
-
async def __aexit__(
|
|
241
|
+
async def __aexit__(
|
|
242
|
+
self,
|
|
243
|
+
exc_type: type[BaseException] | None,
|
|
244
|
+
exc_val: BaseException | None,
|
|
245
|
+
exc_tb: TracebackType | None,
|
|
246
|
+
) -> None:
|
|
240
247
|
await self.close()
|
|
241
248
|
|
|
242
|
-
async def close(self):
|
|
249
|
+
async def close(self) -> None:
|
|
243
250
|
"""Close the underlying HTTP client."""
|
|
244
251
|
await self._http_client.aclose()
|
|
245
252
|
|
lixinger/exceptions.py
CHANGED
|
@@ -5,7 +5,7 @@ class LixingerError(Exception):
|
|
|
5
5
|
class APIError(LixingerError):
|
|
6
6
|
"""API request failed."""
|
|
7
7
|
|
|
8
|
-
def __init__(self, message: str, status_code: int | None = None):
|
|
8
|
+
def __init__(self, message: str, status_code: int | None = None) -> None:
|
|
9
9
|
super().__init__(message)
|
|
10
10
|
self.status_code = status_code
|
|
11
11
|
|
lixinger/utils/rate_limiter.py
CHANGED
|
@@ -6,7 +6,7 @@ import time
|
|
|
6
6
|
class AsyncRateLimiter:
|
|
7
7
|
"""Async token bucket rate limiter."""
|
|
8
8
|
|
|
9
|
-
def __init__(self, max_requests: int, window: float = 60.0):
|
|
9
|
+
def __init__(self, max_requests: int, window: float = 60.0) -> None:
|
|
10
10
|
self.max_requests = max_requests
|
|
11
11
|
self.window = window
|
|
12
12
|
self.requests: deque[float] = deque()
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
lixinger/__init__.py,sha256=q-HBT1HyVJ6NKlsP_T6T5WCq_bYn330wAo9bsfD-lNQ,2750
|
|
2
|
-
lixinger/client.py,sha256=
|
|
2
|
+
lixinger/client.py,sha256=_oj9vlfMTWDbbn89A3DCZ0epBY2nMs1iQKBIrLO4vQA,12905
|
|
3
3
|
lixinger/config.py,sha256=JPz8EOrf1kP4Do-Z5-MsnOM0pMrNE1ZsP-Qoarh9y4c,2008
|
|
4
|
-
lixinger/exceptions.py,sha256=
|
|
4
|
+
lixinger/exceptions.py,sha256=haJOQzZinH0tKk_e2BTUzJfPbtnyLHyRR7HSnWHeKfk,516
|
|
5
5
|
lixinger/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
lixinger/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
lixinger/api/base.py,sha256=
|
|
7
|
+
lixinger/api/base.py,sha256=j90uXrBEIHyPkTu-4hF1876HtsWIPM_J7tunFi-1O1Q,3182
|
|
8
8
|
lixinger/api/cn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
lixinger/api/cn/company/__init__.py,sha256=K8aNp2gGj4iQOvc8KjXA5668QUAhwyTfMBPhP3tgtMg,961
|
|
10
10
|
lixinger/api/cn/company/announcement.py,sha256=lYt4AWOV5b9OTKfvJ7ZOqWP61pcPcyIQzb5N2DqFT6k,1920
|
|
@@ -13,7 +13,7 @@ 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=0YVK79MZJpH6p70vdNFgjkm0K0bc4QO9feFq8B3mYJY,6878
|
|
17
17
|
lixinger/api/cn/company/profile.py,sha256=iMwR5REcJNhKvS3hpWg6bCD1DOH-7fSN21zoIeRIh3k,1691
|
|
18
18
|
lixinger/api/cn/company/fs/__init__.py,sha256=B21nlQ_kwTvtwGbRovbsPQfDuj5rf3YqNp03orgpV0g,1281
|
|
19
19
|
lixinger/api/cn/company/fs/bank.py,sha256=rdUvFNVWwF1ZCMzy_a6Sc7e-NUykb8OfU4MnAL-EUI4,4514
|
|
@@ -43,7 +43,7 @@ lixinger/api/cn/index/drawdown.py,sha256=D-fhA-Sv2-gf6VzX0zG1dm7Tn5Wy7NK1IB-f5kF
|
|
|
43
43
|
lixinger/api/cn/index/fundamental.py,sha256=MyhGmMk7GkOZflpT0JMoiLsCs3DLMLLkopyUsD94Y4Q,2474
|
|
44
44
|
lixinger/api/cn/index/index.py,sha256=5gDwE5K3tYNlCrV-EsSC4HXhfIi58uqWpHQxTt9LJMk,4177
|
|
45
45
|
lixinger/api/cn/index/margin_trading.py,sha256=Tr5nXXC5H38FoAB5RoiTysr2wQEB0K4i4eKcEZnV4dw,4161
|
|
46
|
-
lixinger/api/cn/index/namespace.py,sha256=
|
|
46
|
+
lixinger/api/cn/index/namespace.py,sha256=GQrvboQiqXOpY7KULhIt-BwOqYktpelHp-fSQUSq120,6413
|
|
47
47
|
lixinger/api/cn/index/tracking_fund.py,sha256=su0zJRROKuTZlHe0XkIQz8kJOyPZmyg7HxZIbmpM_YM,1960
|
|
48
48
|
lixinger/api/cn/index/fs/__init__.py,sha256=eQTxjzZfiqxDU8WdLA-deAtus-nYEiO2mLq2gOkFTts,1060
|
|
49
49
|
lixinger/api/cn/index/fs/bank.py,sha256=zjDB_d06E_gxAvVNyk9Byoa5ShlevNoc75z5gVBH6aY,4416
|
|
@@ -97,9 +97,9 @@ lixinger/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
97
97
|
lixinger/utils/api.py,sha256=BktR40JtKCMe9excFWo4ujsq3GiQK4ypJLG3MpJgo2s,402
|
|
98
98
|
lixinger/utils/dataframe.py,sha256=tYBrNdmJ4poyuwD-9XgzHt3A_A8bBo0cdHiu8Yy9e9A,2208
|
|
99
99
|
lixinger/utils/dict.py,sha256=yvbUtv8QpRmy0d_o_7gCuEwwiEfBji5_xB490ANxilw,589
|
|
100
|
-
lixinger/utils/rate_limiter.py,sha256=
|
|
100
|
+
lixinger/utils/rate_limiter.py,sha256=ZHlRTTL60L62uRA_f--LD26qkAfk-pHBllRqPapAXQM,1141
|
|
101
101
|
lixinger/utils/retry.py,sha256=sXtb0ESp12_JedjzDxoeIH48TlOrbxtIA0j1V33DW7M,1026
|
|
102
|
-
lixinger_python-0.3.
|
|
103
|
-
lixinger_python-0.3.
|
|
104
|
-
lixinger_python-0.3.
|
|
105
|
-
lixinger_python-0.3.
|
|
102
|
+
lixinger_python-0.3.10.dist-info/METADATA,sha256=dSxFGEZE6ajZsnOnLeMc4dKYCyXK2-ZYlTLGsrEhYJI,9207
|
|
103
|
+
lixinger_python-0.3.10.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
104
|
+
lixinger_python-0.3.10.dist-info/licenses/LICENSE,sha256=5oOwRq1lHSOScbNGCHr2feuNnhNYdGcArj6fSUfsC5U,1064
|
|
105
|
+
lixinger_python-0.3.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|