moexapi 1.7.13__tar.gz → 1.7.15__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moexapi
3
- Version: 1.7.13
3
+ Version: 1.7.15
4
4
  Summary: Python API for MOEX ISS
5
5
  Author-email: Aliaksei Rak <kventinel@gmail.com>
6
6
  License: MIT License
@@ -39,7 +39,8 @@ class Coupon:
39
39
  @dataclasses.dataclass
40
40
  class Offer:
41
41
  date: datetime.date
42
- value: float
42
+ value: T.Optional[float]
43
+ type: str = ""
43
44
 
44
45
 
45
46
  @dataclasses.dataclass(init=True)
@@ -124,7 +125,10 @@ class Bond:
124
125
  continue
125
126
  date = datetime.date.fromisoformat(offer_date)
126
127
  end_date = _max(end_date, date)
127
- item = Offer(date=date, value=line["value"])
128
+ value = line.get("value")
129
+ if value is None and line.get("price") is not None and line.get("facevalue") is not None:
130
+ value = float(line["facevalue"]) * float(line["price"]) / 100
131
+ item = Offer(date=date, value=value, type=line.get("offertype") or "")
128
132
  if item not in self.offers:
129
133
  self.offers.append(item)
130
134
  if end_date == start_date:
@@ -63,7 +63,8 @@ class Candle:
63
63
  self.high *= mult
64
64
  self.open *= mult
65
65
  self.close *= mult
66
- self.value *= mult
66
+ if self.volume is not None:
67
+ self.volume /= mult
67
68
 
68
69
 
69
70
  def _merge_candles(first: list[Candle], second: list[Candle]) -> list[Candle]:
@@ -71,8 +71,8 @@ class History:
71
71
  self.open *= mult
72
72
  self.close *= mult
73
73
  self.mid_price *= mult
74
- if self.value is not None:
75
- self.value *= mult
74
+ if self.volume is not None:
75
+ self.volume /= mult
76
76
 
77
77
 
78
78
  def _merge_history(first: list[History], second: list[History]) -> list[History]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moexapi
3
- Version: 1.7.13
3
+ Version: 1.7.15
4
4
  Summary: Python API for MOEX ISS
5
5
  Author-email: Aliaksei Rak <kventinel@gmail.com>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "moexapi"
7
- version = "1.7.13"
7
+ version = "1.7.15"
8
8
  description = "Python API for MOEX ISS"
9
9
  readme = "README.md"
10
10
  authors = [{ name = "Aliaksei Rak", email = "kventinel@gmail.com" }]
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