moexapi 1.7.6__tar.gz → 1.7.8__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.6 → moexapi-1.7.8}/PKG-INFO +1 -1
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi/bonds.py +18 -14
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi.egg-info/PKG-INFO +1 -1
- {moexapi-1.7.6 → moexapi-1.7.8}/pyproject.toml +1 -1
- {moexapi-1.7.6 → moexapi-1.7.8}/LICENSE +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/README.md +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi/__init__.py +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi/candles.py +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi/changeover.py +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi/dividends.py +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi/exchange.py +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi/history.py +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi/markets.py +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi/splits.py +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi/tickers.py +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi/utils.py +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi.egg-info/SOURCES.txt +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi.egg-info/dependency_links.txt +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi.egg-info/requires.txt +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/moexapi.egg-info/top_level.txt +0 -0
- {moexapi-1.7.6 → moexapi-1.7.8}/setup.cfg +0 -0
|
@@ -28,7 +28,7 @@ class Amortization:
|
|
|
28
28
|
@dataclasses.dataclass
|
|
29
29
|
class Coupon:
|
|
30
30
|
date: datetime.date
|
|
31
|
-
start_date: datetime.date
|
|
31
|
+
start_date: T.Optional[datetime.date]
|
|
32
32
|
value: float
|
|
33
33
|
initialfacevalue: float
|
|
34
34
|
|
|
@@ -99,30 +99,34 @@ class Bond:
|
|
|
99
99
|
for line in amortization:
|
|
100
100
|
date = datetime.date.fromisoformat(line["amortdate"])
|
|
101
101
|
end_date = _max(end_date, date)
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
item = Amortization(
|
|
103
|
+
date=date,
|
|
104
|
+
value=line["value"],
|
|
105
|
+
initialfacevalue=line["initialfacevalue"],
|
|
104
106
|
)
|
|
107
|
+
if item not in self.amortization:
|
|
108
|
+
self.amortization.append(item)
|
|
105
109
|
for line in coupons:
|
|
106
110
|
date = datetime.date.fromisoformat(line["recorddate"] if line["recorddate"] else line["coupondate"])
|
|
107
111
|
end_date = _max(end_date, date)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
)
|
|
112
|
+
item = Coupon(
|
|
113
|
+
date=date,
|
|
114
|
+
start_date=datetime.date.fromisoformat(line["startdate"])
|
|
115
|
+
if line.get("startdate") else None,
|
|
116
|
+
value=line["value"],
|
|
117
|
+
initialfacevalue=line["initialfacevalue"],
|
|
115
118
|
)
|
|
119
|
+
if item not in self.coupons:
|
|
120
|
+
self.coupons.append(item)
|
|
116
121
|
for line in offers:
|
|
117
122
|
date = datetime.date.fromisoformat(line["offerdate"])
|
|
118
123
|
end_date = _max(end_date, date)
|
|
119
|
-
|
|
124
|
+
item = Offer(date=date, value=line["value"])
|
|
125
|
+
if item not in self.offers:
|
|
126
|
+
self.offers.append(item)
|
|
120
127
|
if end_date == start_date:
|
|
121
128
|
break
|
|
122
129
|
start_date = end_date
|
|
123
|
-
self.amortization = [item for item in self.amortization if item.date != start_date]
|
|
124
|
-
self.coupons = [item for item in self.coupons if item.date != start_date]
|
|
125
|
-
self.offers = [item for item in self.offers if item.date != start_date]
|
|
126
130
|
original_values = [item.value for item in self.amortization]
|
|
127
131
|
amortization_sum = sum(original_values)
|
|
128
132
|
if abs(amortization_sum - self.initial_face_value) > 1e-9 and len(original_values) > 1:
|
|
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
|
|
File without changes
|