moexapi 1.6.44__tar.gz → 1.6.46__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.6.44
3
+ Version: 1.6.46
4
4
  Summary: Python API for MOEX ISS
5
5
  Author-email: Aliaksei Rak <kventinel@gmail.com>
6
6
  License: MIT License
@@ -103,7 +103,7 @@ class Bond:
103
103
  Amortization(date=date, value=line["value"], initialfacevalue=line["initialfacevalue"])
104
104
  )
105
105
  for line in coupons:
106
- date = datetime.date.fromisoformat(line["coupondate"])
106
+ date = datetime.date.fromisoformat(line["recorddate"])
107
107
  end_date = _max(end_date, date)
108
108
  self.coupons.append(
109
109
  Coupon(
@@ -125,7 +125,7 @@ class Bond:
125
125
  self.offers = [item for item in self.offers if item.date != start_date]
126
126
  original_values = [item.value for item in self.amortization]
127
127
  amortization_sum = sum(original_values)
128
- if abs(amortization_sum - self.initial_face_value) > 1e-9:
128
+ if abs(amortization_sum - self.initial_face_value) > 1e-9 and len(original_values) > 1:
129
129
  values = [value / amortization_sum * self.initial_face_value for value in original_values]
130
130
  rounded_values = [round(value + 1e-9, 2) for value in values]
131
131
  for original_value, rounded_value in zip(original_values, rounded_values):
@@ -178,7 +178,7 @@ class Bond:
178
178
  date_from = date_from or datetime.date.today()
179
179
  result = [offer for offer in self.offers if offer.date >= date_from]
180
180
  return result[0] if len(result) > 0 else None
181
-
181
+
182
182
  def has_next_offer(self, date_from: T.Optional[datetime.date] = None) -> bool:
183
183
  return self.next_offer(date_from=date_from) is not None
184
184
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moexapi
3
- Version: 1.6.44
3
+ Version: 1.6.46
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.6.44"
7
+ version = "1.6.46"
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
File without changes
File without changes