moexapi 1.7.1__tar.gz → 1.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {moexapi-1.7.1 → moexapi-1.7.2}/PKG-INFO +1 -1
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi/markets.py +8 -2
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi/tickers.py +5 -3
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi.egg-info/PKG-INFO +1 -1
- {moexapi-1.7.1 → moexapi-1.7.2}/pyproject.toml +1 -1
- {moexapi-1.7.1 → moexapi-1.7.2}/LICENSE +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/README.md +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi/__init__.py +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi/bonds.py +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi/candles.py +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi/changeover.py +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi/dividends.py +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi/exchange.py +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi/history.py +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi/splits.py +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi/utils.py +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi.egg-info/SOURCES.txt +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi.egg-info/dependency_links.txt +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi.egg-info/requires.txt +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/moexapi.egg-info/top_level.txt +0 -0
- {moexapi-1.7.1 → moexapi-1.7.2}/setup.cfg +0 -0
|
@@ -9,11 +9,13 @@ class Market:
|
|
|
9
9
|
engines: set[str] = frozenset(),
|
|
10
10
|
markets: set[str] = frozenset(),
|
|
11
11
|
boards: set[str] = frozenset(),
|
|
12
|
+
security_types: set[str] = frozenset(),
|
|
12
13
|
):
|
|
13
14
|
self._name = name
|
|
14
15
|
self._engines = engines
|
|
15
16
|
self._markets = markets
|
|
16
17
|
self._boards = boards
|
|
18
|
+
self._security_types = security_types
|
|
17
19
|
self._parent = parent
|
|
18
20
|
self._childs: list["Market"] = []
|
|
19
21
|
if parent:
|
|
@@ -51,6 +53,10 @@ class Market:
|
|
|
51
53
|
@property
|
|
52
54
|
def boards(self) -> set[str]:
|
|
53
55
|
return self._join("_boards")
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def security_types(self) -> set[str]:
|
|
59
|
+
return self._join("_security_types")
|
|
54
60
|
|
|
55
61
|
def childs(self) -> list["Market"]:
|
|
56
62
|
if len(self._childs) == 0:
|
|
@@ -93,8 +99,8 @@ class Market:
|
|
|
93
99
|
_ALL = Market("all")
|
|
94
100
|
_STOCK = Market("stock", parent=_ALL, engines={"stock"})
|
|
95
101
|
_EQUITY = Market("equity", parent=_STOCK, markets={"shares"})
|
|
96
|
-
_SHARES = Market("shares", parent=_EQUITY,
|
|
97
|
-
_ETFS = Market("etfs", parent=_EQUITY,
|
|
102
|
+
_SHARES = Market("shares", parent=_EQUITY, security_types={"common_share", "preferred_share", "depositary_receipt"})
|
|
103
|
+
_ETFS = Market("etfs", parent=_EQUITY, security_types={"exchange_ppif"})
|
|
98
104
|
_BONDS = Market("bonds", parent=_STOCK, markets={"bonds"})
|
|
99
105
|
_FEDERAL_BONDS = Market("federal bonds", parent=_BONDS, boards={"TQOB"})
|
|
100
106
|
_COMPANY_BONDS = Market("company bonds", parent=_BONDS, boards={"TQCB"})
|
|
@@ -80,7 +80,7 @@ class TickerBoardInfo:
|
|
|
80
80
|
result = None
|
|
81
81
|
for sec_line, market_line in zip(securities, marketdata):
|
|
82
82
|
board = sec_line[BOARDID]
|
|
83
|
-
if
|
|
83
|
+
if board != primary_board:
|
|
84
84
|
boards.append(board)
|
|
85
85
|
continue
|
|
86
86
|
else:
|
|
@@ -197,7 +197,7 @@ class Ticker:
|
|
|
197
197
|
result = cls(
|
|
198
198
|
secid=listing.secid,
|
|
199
199
|
alias=listing.secid,
|
|
200
|
-
is_traded=
|
|
200
|
+
is_traded=listing.is_traded,
|
|
201
201
|
market=listing.market,
|
|
202
202
|
shortname=listing.shortname,
|
|
203
203
|
isin=info.isin,
|
|
@@ -279,6 +279,8 @@ def _parse_tickers(market: markets.Market = markets.Markets.ALL) -> list[Listing
|
|
|
279
279
|
if len(securities) == 0:
|
|
280
280
|
break
|
|
281
281
|
for line in securities:
|
|
282
|
+
if child_market.security_types and line.get("type") not in child_market.security_types:
|
|
283
|
+
continue
|
|
282
284
|
isin = line["isin"]
|
|
283
285
|
if isin is None and child_market != markets.Markets.CURRENCY:
|
|
284
286
|
continue
|
|
@@ -305,7 +307,7 @@ def get_ticker(secid: str, market: markets.Market = markets.Markets.ALL, allow_d
|
|
|
305
307
|
def get_tickers(
|
|
306
308
|
market: markets.Market = markets.Markets.ALL,
|
|
307
309
|
is_traded: T.Optional[bool] = None,
|
|
308
|
-
limit: int = None
|
|
310
|
+
limit: T.Optional[int] = None
|
|
309
311
|
) -> list[Ticker]:
|
|
310
312
|
tickers = _parse_tickers(market=market)
|
|
311
313
|
result = []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|